Visual Basic Classic
--
Questions
--
Followers
Top Experts
I have a DLL written in C++, which exports a DLL the following way:
bool __stdcall MyFunc(unsigned __int64 param1)
I need to use this in VB6. However VB6 does not have unsigned long type and I cannot find another 64 bit type that I can easily convert to. Any ideas?
TheAvenger
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
You can pass an entire user-defined type as a single argument if you pass it by reference. User-defined types cannot be passed by value.
I think I need to pass it by value in order to work.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Declare Function MyFunc Lib "MyDLL" (param1 As MyType) As Boolean
Declare Function MyFunc Lib "MyDLL" (param1 As Currency) As Boolean

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Is there an error message?
No, unfortunately the DLL is a property of the company :-((
Pass in the UDT to your bridge or wrapper C++ dll which converts it into an __int64 which in turn calls MyFunc with a true __int64.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
LSet SomeValue = ReturlValue
Debug.Print SomeValue
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
  Dim c As Currency
  Dim hiWord As Long
  Dim loWord As Long
 Â
  hiWord = &H12345678
  loWord = &H87654321
 Â
  Call CopyMemory(ByVal VarPtr(c), hiWord, 4)
  Call CopyMemory(ByVal VarPtr(c) + 4, loWord, 4)
Now, c contains the 64 bit result

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Please post here: https://www.experts-exchange.com/questions/21579889/A-question-for-egl1044.html
Visual Basic Classic
--
Questions
--
Followers
Top Experts
Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.