473,242 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,242 software developers and data experts.

declare API without direct file name

hi, i need to have a declare statement for an API to call a method in it, the
only problem is that i dont neccessarily know where on the comp it will be. I
kno it will be in my application folder, but how do i say that in the
declares statement? for instance, i have this

Private Declare Sub AccCreateSession Lib "acccore.dll" Alias "#111" _
(<MarshalAs(UnmanagedType.LPStruct)ByVal Name As Guid,
<MarshalAs(UnmanagedType.IDispatch)ByRef session As Object)

but it cant find it, ive also tried

Private Declare Sub AccCreateSession Lib "..\acccore.dll" Alias "#111" _
(<MarshalAs(UnmanagedType.LPStruct)ByVal Name As Guid,
<MarshalAs(UnmanagedType.IDispatch)ByRef session As Object)

but that doesnt work either.....how can i do this?
--
-iwdu15
Aug 10 '06 #1
5 2336

iwdu15 wrote:
hi, i need to have a declare statement for an API to call a method in it, the
only problem is that i dont neccessarily know where on the comp it will be. I
kno it will be in my application folder, but how do i say that in the
declares statement? for instance, i have this

Private Declare Sub AccCreateSession Lib "acccore.dll" Alias "#111" _
(<MarshalAs(UnmanagedType.LPStruct)ByVal Name As Guid,
<MarshalAs(UnmanagedType.IDispatch)ByRef session As Object)

but it cant find it, ive also tried

Private Declare Sub AccCreateSession Lib "..\acccore.dll" Alias "#111" _
(<MarshalAs(UnmanagedType.LPStruct)ByVal Name As Guid,
<MarshalAs(UnmanagedType.IDispatch)ByRef session As Object)

but that doesnt work either.....how can i do this?
What error do you get exactly? The declare will find the dll as long
as it is in the search path, and by default the current directory is in
that path....

--
Tom Shelton [MVP]

Aug 10 '06 #2
"iwdu15" <jmmgoalsteratyahoodotcomschrieb:
hi, i need to have a declare statement for an API to call a method in it,
the
only problem is that i dont neccessarily know where on the comp it will
be. I
kno it will be in my application folder, but how do i say that in the
declares statement? for instance, i have this

Private Declare Sub AccCreateSession Lib "acccore.dll" Alias "#111" _
(<MarshalAs(UnmanagedType.LPStruct)ByVal Name As Guid,
<MarshalAs(UnmanagedType.IDispatch)ByRef session As Object)

but it cant find it, ive also tried

Private Declare Sub AccCreateSession Lib "..\acccore.dll" Alias "#111" _
(<MarshalAs(UnmanagedType.LPStruct)ByVal Name As Guid,
<MarshalAs(UnmanagedType.IDispatch)ByRef session As Object)

but that doesnt work either.....how can i do this?
Are you really sure the DLL is in the directory where your executable file
resides? You may have to copy the DLL to your project's "bin" folder in
order to be able to start the application from within the IDE.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Aug 10 '06 #3
im positive its there...i copied it myself. it was originally in a directory
off of C:\ but then to release my app, i copied to the Bin directory, and
changed the code to what i showed above. making sure i was running in Debug
mode, it wouldnt find the dll.....
--
-iwdu15
Aug 10 '06 #4
the dll is in the "bin" directory, as is the application. i get an error
saying it could not load the said module....but when i hardcode the path it
works
--
-iwdu15
Aug 11 '06 #5
il also add, if it helps, that this is a COM object. I have to declare it
like so to have the dll create an object for me. I also have it imported in
my references....if this helps at all
--
-iwdu15
Aug 11 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sebastien Tardif | last post by:
Subject: XmlSerializer.Deserialize complain when root declare the namespace If I do XmlSerializer.Deserialize( myString ) and myString is: String myString = "<?xml version=\"1.0\"...
9
by: WalterR | last post by:
This is my first time here, so there may be earlier relevant threads of which I am unaware. Though my experience with DB2 is not extensive, such as it is was under OS/390 or equ. My main...
7
by: Kobu | last post by:
The code below isn't compiling for me (error message: conflicting types for 'total' - pointing to the extern declaration). Why wouldn't this work, since the types are different, the extern...
2
by: pv | last post by:
Hi everyone, I need help with following scenario, please: Users are accessing same web server from intranet (users previously authenticated in Active Dir) and from extranet (common public...
16
by: didier.doussaud | last post by:
I have a stange side effect in my project : in my project I need to write "gobal" to use global symbol : .... import math .... def f() : global math # necessary ?????? else next line...
23
by: mark.moore | last post by:
I know this has been asked before, but I just can't find the answer in the sea of hits... How do you forward declare a class that is *not* paramaterized, but is based on a template class? ...
21
by: Mark Cooney | last post by:
Good afternoon, yes i am a newby so pls keep it simple. Yesterday I started a small project where I have to make an API call and receive back from that the long xml transcript down below. Now,...
0
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new...
10
by: Tammy | last post by:
Hello all, I am wondering what is the best way to declare a struct to be used in other c and c++ files. Such as for a C API that will be used by others. 1. Declaring the typedef and the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.