473,796 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 AccCreateSessio n Lib "acccore.dl l" Alias "#111" _
(<MarshalAs(Unm anagedType.LPSt ruct)ByVal Name As Guid,
<MarshalAs(Unma nagedType.IDisp atch)ByRef session As Object)

but it cant find it, ive also tried

Private Declare Sub AccCreateSessio n Lib "..\acccore.dll " Alias "#111" _
(<MarshalAs(Unm anagedType.LPSt ruct)ByVal Name As Guid,
<MarshalAs(Unma nagedType.IDisp atch)ByRef session As Object)

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

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 AccCreateSessio n Lib "acccore.dl l" Alias "#111" _
(<MarshalAs(Unm anagedType.LPSt ruct)ByVal Name As Guid,
<MarshalAs(Unma nagedType.IDisp atch)ByRef session As Object)

but it cant find it, ive also tried

Private Declare Sub AccCreateSessio n Lib "..\acccore.dll " Alias "#111" _
(<MarshalAs(Unm anagedType.LPSt ruct)ByVal Name As Guid,
<MarshalAs(Unma nagedType.IDisp atch)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" <jmmgoalsteraty ahoodotcomschri eb:
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 AccCreateSessio n Lib "acccore.dl l" Alias "#111" _
(<MarshalAs(Unm anagedType.LPSt ruct)ByVal Name As Guid,
<MarshalAs(Unma nagedType.IDisp atch)ByRef session As Object)

but it cant find it, ive also tried

Private Declare Sub AccCreateSessio n Lib "..\acccore.dll " Alias "#111" _
(<MarshalAs(Unm anagedType.LPSt ruct)ByVal Name As Guid,
<MarshalAs(Unma nagedType.IDisp atch)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....i f 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
11806
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\" encoding=\"utf-16\"?><DocumentResponse ><documentSize xmlns=\"urn:webservices.docharbor.com\">23</documentSize></DocumentResponse>"; It's working
9
3181
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 experience is IMS DB, which leads to my question. In IMS, there is an HDAM access method which can find a record without using an index as such. At initial database load, it first formats the entire space allocation into blocks of the given size. ...
7
2194
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 declaration obviously refers to the 'long total' in total.c? Is my compiler wrong? total.c
2
2913
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 users). If user is from intranet, web server should recognize it and application should create additional options in controls regarding groups the user belongs to. If user is from extranet it should be logged in as anonymous and a link to login page...
16
3116
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 generate an error message ?????
23
3868
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? Here's what I thought should work, but apparently doesn't: class Foo; void f1(Foo* p)
21
1951
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, not knowing about XML I have experienced one or 2 issues. Firstly, this is the code I have created to make the call and then extract a few bits of information:
0
8332
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 records there is an error "Incorrect syntax near '-'. Must declare the scalar variable "@UserName". I worked out in design view,code is automatically generated.Iam not able fix the error. Iam working with Visual Web Developer-2005 Express Edition
10
2486
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 struct in the header file and including this file in all source files that need it? For example: mystruct.h
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10187
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.