on 3/10/06 3:25 AM, Kristof Coene at kristofcoene at gmail dot com wrote:
> Hi guys,
>
> I'm pretty new to the RealBasicPlugin-scene, working on my first plug-in for
> windows and Mac.
> But I have a problem: for windows, I made a DLL in C++ that the plugin can
> copy to a specific location,
> and I also need a .txt file in the same directory as the DLL. Now, my DLL
> needs the information of the
> .txt file to work properly, but it seems that I cannot get the path where
> the DLL is in.
> Is there any way to let the DLL know in wich path it is in?
> I used
>
> CreateFile("test.txt", GENERIC_READ, 0, NULL, OPEN_EXISTING,
> FILE_ATTRIBUTE_NORMAL, NULL);
>
> but that directs me to C:\documents and settings\Administrator\test.txt
> while my DLL is in another drectory.
> Can you guys help me?
In the DllMain method you can call GetModuleFileName to get the path to the
DLL.
Chris
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
From Fri 10 Mar 2006 14:30:04 +0100
Return-Path: <realbasic-plugins-bounces at lists dot realsoftware dot com>
Received: from lists.realsoftware.com (209.198.132.125) by realsoftware.com
with ESMTP (Eudora Internet Mail Server 3.1.3);
Fri, 10 Mar 2006 07:30:24 -0600
Received: from lists.realsoftware.com (localhost [127.0.0.1])
by lists.realsoftware.com (Postfix) with ESMTP
id F35D81157A1D; Fri, 10 Mar 2006 07:30:15 -0600 (CST)
X-Original-To: realbasic-plugins at lists dot realsoftware dot com
Delivered-To: realbasic-plugins at lists dot realsoftware dot com
Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de
[80.67.18.16])
by lists.realsoftware.com (Postfix) with ESMTP id 745A21157A10
for <realbasic-plugins at lists dot realsoftware dot com>;
Fri, 10 Mar 2006 07:30:10 -0600 (CST)
Received: (qmail 5328 invoked from network); 10 Mar 2006 13:30:04 -0000
Received: from unknown (HELO [192.168.1.80]) (363246 at [84 dot 175 dot 103 dot
85])
(envelope-sender <support at monkeybreadsoftware dot info>)
by smtprelay04.ispgateway.de (qmail-ldap-1.03) with SMTP
for <realbasic-plugins at lists dot realsoftware dot com>;
10 Mar 2006 13:30:04 -0000
To: realbasic-plugins at lists dot realsoftware dot com (REALbasic Plugins)
In-Reply-To: <b549a0c70603100025w75bca3c0u at mail dot gmail dot com>
From: support at monkeybreadsoftware dot info (Christian Schmitz)
Date: Fri, 10 Mar 2006 14:30:04 +0100
Message-ID: <1hbzmwx dot tb95pz282hv2M%support at monkeybreadsoftware dot info>
Organization: Monkeybread Software Germany
X-Face: nrf3>{WQ6c&r+7 at e)"]0G60`-6ND^)I2mI%>)QGYa=9"=7jhd-g2|b3!>Al0+
Ccb%xGQshhi|g at QU2$
User-Agent: MacSOUP/D-2.7 (Mac OS X version 10.4.5)
Subject: Re: Path of DLL
X-BeenThere: realbasic-plugins at lists dot realsoftware dot com
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot
com>
Sender: realbasic-plugins-bounces at lists dot realsoftware dot com
Errors-To: realbasic-plugins-bounces at lists dot realsoftware dot com
Kristof Coene <kristofcoene at gmail dot com> wrote:
> Hi guys,
>
> .txt file to work properly, but it seems that I cannot get the path where
> the DLL is in.
GetModuleHandle for the DLL and than there was a path query function for
a module. You should find that in the docs at msdn.microsoft.com.
Mfg
Christian
--
Around eleven thousand functions in one REALbasic plug-in.
The Monkeybread Software Realbasic Plugin.
<http://www.monkeybreadsoftware.de/realbasic/plugins.shtml>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|