Use Unmanaged Dlls By Declaring Their Functions?
Jan 16, 2011
in vb 2005 I used to be able to use unmanaged dlls by declaring their functions.But in vb 2010 it doesnt work.How is it done. The dlls i need to use vary, some made using delphi, some made using c++.
View 2 Replies
ADVERTISEMENT
Apr 2, 2009
Accessing Dlls functions/objects using VBScript
View 2 Replies
Jul 19, 2009
i have have a few questions about the syntax of the lan.:
1) What is the 'Get' statement and when do you use it?
2) Whats the difference between public, private, protected etc... when declaring functions and subs.
3) When would you use the overrides property?
View 4 Replies
Oct 19, 2011
I just got upgraded from VB6.0 to VB2010. I'm trying to move some of my program functions over and I'm getting an error on the ones where I use optional... Public Function GetFolder(ByRef FTT As String, Optional InitFile As String)
I get the error at the end of the line, after the close par...the error is "optional parameters must specify a default value".
View 3 Replies
Apr 6, 2010
I am trying to understand how to interact with external DLLs written in C++ for use in my VB.NET application. I have some DLLs that a client wrote that do some math functions. Everything was working on a 32-bit machine. Because we were taxing the 32-bit machine we moved to 64-bit. Now we can't get the same functions to work. The DLLs were re-compiled as 64-bit DLLs and they still don't work. So my client wrote some dummy DLLs to see if we could figure out the problem. Here are the "signatures" of the DLL calls that I am making:[code]....Ultimately I would like to get to calling initialize_quiet and I am guessing at the format of the marshalling, const size etc.
View 3 Replies
Dec 6, 2010
What I am trying to do is have a class where the functions of the same name are both instance functions and shared functions.
Public Shared Function Get...(byval xx as xx)
and
Public Function Get...
The Public Function uses a Property xx created in the constructor, whereas the Shared Function has the parameters (byval xx as xx).
View 1 Replies
Jan 29, 2007
1) Is it possible to access the Excel mathematical functions without actually opening Excel?
I was thinking of through a DLL WinAPI call or maybe a delegate function or smaller program?
2) Does anyone know of a MS link or area that gives instruction on "how to" use every function of every Windows DLL at all?
Or for all those that Microsoft have chosen to document online at least.
View 1 Replies
Jan 8, 2010
i need to pass commands through a C++ dll to vb.net and the other way around. is there some code that needs to be in the C++ dll to make it work? im not good at C++ at all,
View 5 Replies
Feb 19, 2009
While converting types, I have found myself using both VB functions and BCL Convert.To* methods.
E.g.)
Cstr() vs. Convert.ToString()
CInt() vs. Convert.ToInt32()
CDbl() vs. Convert.ToInt64()
etc...
Are there any subtle differences that should be noted?
View 1 Replies
Mar 4, 2009
Is there a way to see exactly what the functions are doing. What i mean is there a way to see the class? I know what it does, i just want to know the code.
For example the function: Membership.FindUsersByName()
View 1 Replies
Oct 9, 2010
im trying to make a simple wrapper for lua. The only problem so far is that lua only accepts a method in a specific format.Delegate Function LuaC Function(ByVal lua_state As IntPtr) As Integer..That is how lua wants the method to look like. So it only accepts a function that looks like this: [code]
View 2 Replies
Jan 5, 2010
I created a vb.net dll called "WSdll.dll".I compiled it, created a type library (tlb), and registered it globally(gacutil)..It includes a file called wsutils.vb, which includes a namespace called "wsutils".In the namespace, there's an interface (with attribute) called "IWSconnection", and a class called "WSconnection".The interface and class are public, as are all methods and properties.[code]...
View 2 Replies
May 18, 2012
I have an application written in .NET 4.0 that needs to load in memory a native DLL (written C). At the moment I am using a P/Invoke call to LoadLibrary passing the path where the DLL is located. This works, but due to the fact that this DLL comes from a DB, I would like to know if it is possible loading it through a stream, avoiding then the necessity to store the DLL somewhere in the filesystem.
View 2 Replies
May 5, 2009
I have an application which has been succesfully installed on a number of different client machines.
The problem I now have is that I have been asked to allow third party applications, possibly written in a non .net language set to plug into my application and execute some of the code. Just a handfull of properties and half a dozen methods.
Now I can wrap up these properties/methods, make them public and have them in their own project which will be part of my solution but I have no idea where to go from here.
How do I make this portion of my application accessible to a third party application written in unmanaged code ?
View 1 Replies
May 25, 2010
Question: I use an embedded Firebird database in ASP.NET.
Now, Firebird has a .NET wrapper around native dlls.
The problem is, with the ASP.NET compilation and execution process, the dlls get shadow copied to a temporary folder. Unfortunately, only the .NET dlls, and not the native dll.
See [URL] for details.
Now, this makes it necessary to put the unmanaged dll somewhere into the system32 directory (or any other directory in the path environment variable).
Now, I want to change the wrapper/native dll (opensource), so it loads the dlls also if they are only in the bin folder.
Now, my problem is, how can I, in .NET, load an unmanaged dll from an absolute path ? The absolute path is determined at runtime, not at compile-time...
View 2 Replies
Feb 17, 2010
I have an unmanaged DLL and need to call one of its functions. Here's the [code]...
View 5 Replies
Sep 20, 2009
Maybe this is not true ... But how to connect an unmanaged DirectX to VB.NET? For anyone dll I use <DllImport()>, but Unmaged DirectX have interface.... Than I tried use "<ComImport(), Guid(...)...>", but I do not know how to use COM interfaces Maybe I did not really understand COM technolgy... I tried find documentation "how to use com interfaces", but found nothing.
View 1 Replies
Jun 12, 2009
I'm having some trouble finding the syntax for making function calls to unmanaged DLLs in VB.NET. Let's just assume there's a function "Connected" in unmanaged DLL "Connector.DLL". I want to call this function by creating an abstract function call to it.
I've seen some code out there that looks something like
[DllImport("Connector.DLL")]
Public Shared Function Connect(ByVal intPort)
But that syntax doesn't work for me.
View 2 Replies
Mar 3, 2010
I need to call a function in an unmanaged .dll written in C lang from vb.net. The function declaration looks like this [code]Now the behavior of this function is that it copies some data in argument "reply" and returns a numeric value which signals its pass/fail status. How do i pass it a string object so that it can copy data. Following is how i access this function.[code]When the call completes, returned status is absolutely fine but there is nothing in string "str". What is it that i am missing. I'm not sure about the string object that i am passing as argument.
View 3 Replies
Mar 3, 2010
I need to call a function in an unmanaged .dll written in C lang from vb.net. The function declaration looks like thisLONG _stdcall ReadInfo(char *reply);Now the behavior of this function is that it copies some data in argument "reply" and returns a numeric value which signals its pass/fail status. How do i pass it a string object so that it can copy data.Following is how i access this function.
View 2 Replies
Feb 22, 2011
I'm migrating some VB6 code to VB.net,the code contains a structure that contains 1d arrays, 2d arrays, and few other variables.The general outline of the Vb.net structure is as under
[code]...
The call to the dll is declared as under Public Declare Sub getState Lib "val.dll" (ByRef state As Test)Elsewhere on this site I realized that we have to "marshal" the structure to allow it to be compatible with the unmanaged code that is about to accept it.However I still receiving runtime errors when running the code, I don't have any clue of how to use the System.Runtime.InteropServices.Marshal class.What would be the correct way to pass this structure to the dll?EDIT: The original VB6 data type is
[code]...
View 1 Replies
May 23, 2011
What should be the VB signature for the unmanaged function void PopulateBSTR(BSTR outstring)?The function PopulateBSTR does a SysAllocString and populates the string. Note the unmanagaed signature has the argument BSTR and not BSTR*. I can marshal the BSTR string using IntPtr signature when the C++ signature has BSTR* as the argument.
(The unmanaged code is an external dll which I cannot modify but I need to use.)
View 2 Replies
Jul 19, 2009
I've read about this issue on MSDN and on CLR via c#.Imagine we have a 2Mb unmanaged HBITMAP allocated and a 8 bytes managed bitmap pointing to it. What's the point of telling the GC about it with AddMemoryPressure if it is never going to be able to make anything about the object, as it is allocated as unmanaged resource, thus, not susceptible to garbage collections?
View 3 Replies
Sep 19, 2010
I am trying to develop a dll in VisualStudio2005 in vb.net that will communicate with a spectrometer attached to the USB port of the computer.Now the dll exists in C++ and it works like a charm. It is unmanaged code.Now if I try to translate this code in VB.net (because our app is in VB and my boss wants it in VB for maintainability) I have problems.
First of all, I am trying to create a file to open that port. The code in C++ looks like below and it works. Needles to say I tried to call the C++ dll from our app and it works. If I call the vb dll it doesn't. It gives me "access denied" no matter what I tried. I am not sure if my CreateFile is wrong or it's .net. I read somewhere that I need a manifest file included in the dll? Has anyone experience something like this? Why would i get "ACCESS DENIED" all the time?
// close and clear current stuff
ClosePort();
swprintf( sDevice, L"\\?\usb#vid_0765&pid_%s#******#{%s}", Device, PRIVATE_IID_STR );
[code].....
View 4 Replies
May 30, 2012
I need to write a DLL in C that is used a plugin for an existing application.The DLL has to be compiled by the Visual Studio 2008 compiler with the following options.[code]It's then linked to applications library's.What it actually needs to do and what's causing me the issues is that within one of the methods it needs to pull data from a sql server 2008 r2. From what I've seen today you wouldn't be able to do this directly in C as SQL Server past 2005 is designed to communicate with CLR languages( C#, C++, VB.Net).It was suggested that I handle all the database communication with a VB.Net dll and then call said function from within the C dll. Most of what I've found on the topic of calling managed dll's from unmanaged code has talked about pinvoke or com wrappers and mainly from the perspective of c++.
View 2 Replies
Nov 2, 2010
I am using a function from a dll in unmanaged code that requires a callback to my managed code in Visual Basic 2010. The callback is asynchronous and is called continuously over the life of the application. What's the best way to protect the callback function from the garbage collector? Right now it is being collected after several dozen calls from the dll.
View 11 Replies
Feb 18, 2010
I am trying to get some data from a C Dll via a structure and I am getting incorrect values back. I tried a couple of examples I found but they do not work. Since I do not know the proper way. I do not know how to fix it. Can anyone give me any advice, hints, redirection or any assistance what-so-ever. I've been struggling with this for weeks.
View 3 Replies
Jan 28, 2009
I've been using a simple mouse hook and some accessiblity api stuff to retreive caption under mouse (ObjectFromPoint) and accessibility api for events (ObjectFromEvent).It seems like there is memory leaks with unmanaged callbacks.With the global mouse hook it seems there is 4 - 8k of ram added every time the mouse is just moved even though I only monitor mousedown and mouseup with:
Private Const WM_LBUTTONDOWN As UInteger = &H201
Private Const WM_LBUTTONUP As UInteger = &H202
Private Const WM_MBUTTONDOWN As UInteger = &H207
[code]....
And with accessibility it seems there is also memory issues with my code. Is this to do with delegates?I only managed to find one mention on the mouse hook issues which led me in to a dead end.A long shot and maybe not even needed but I was wondering, if these mem leaks can't be stopped, would it free up the memory if I used threads which could be exited and new ones started eg.mem usage 3000k of which 1000k is leaked mem (for round figures) I exit global mouse hook thread and start a new m-hook thread.would this free up the memory? If so, how would i do this, not use threading before.
View 4 Replies
Nov 2, 2011
I'm calling unmanaged C++ Dll function from VB.Net project by usin dllimport attribute like this;
<DllImport("Injection.dll", CallingConvention:=CallingConvention.Cdecl)> _
Private Shared Sub Injector(ByRef Client As String, ByRef Dll As String)
End Sub
View 4 Replies
Aug 29, 2011
I got this DLL functions explained in C++ as below :Void GetResultData(int pIndex,char pStrData[100][255], double pDoubleData[100])
View 2 Replies