 |
|
 |
Plz any one help for
how to access vb6 dll from c/c++ application
advance thanks
|
|
|
|
 |
|
 |
Hi
I have tried to download "Inpout32.dll" and put in my system folder. But, when I try to call "Inpout32.dll" using "out" and "input" functions, using VB6,it send debugging error of "Out and input are not found in Inpout32.dll". so that if you have any idea regarding this error and a solution to access the port using Inpout32.dll, please be fast.
|
|
|
|
 |
|
|
 |
|
 |
I have a problem when I used DLLs and C++.
I need to use the API GetProcAdress, but when
I used a cast:
ptr = (__stdcall *) GetProcAdress(...) the compiler
show an error in stdcall (sintaxe error).
The compiler that I´m using is Borland C++ 4.52.
Thanks for help me.
emails for: placca@interclub.com.br
placca
|
|
|
|
 |
|
|
 |
|
 |
I have been trying for weeks on end to load "ntdll.dll" in c++ and use the function "NtShutdownSystem" from "ntdll.dll". Please help me.
|
|
|
|
 |
|
 |
I have a dll written in c++ which exports a method, this method returns a structure which has function pointers as members.
The exported method populates the function pointers in structure with addresses to non-exported methods in the same dll.
When I import this method in my c# source and invoke the method. I get an System.ArguementException saying "Function pointer was not created by a delegate".
I have double and triple cross checked my delegate declarations corresponding to those function pointers in the structure, I am 100% sure they are correct.
Any help or even pointers to relevent documents would be of great help
|
|
|
|
 |
|
 |
please help me:
how to rectifing the errors:
1.Activex component can't createe com object
2.couldn't create com object
3.object variable or block variable not set
|
|
|
|
 |
|
 |
error:
1.activex cpmponent can't create object
2.couldn't create com object
3.object variable or block variable not set
please mail me sriniwas_m@yahoo.co.in
or sri_vas20@rediffmail.com
|
|
|
|
 |
|
 |
Help me, please...
How call functions define in .h with VB???
Tks
Borges
|
|
|
|
 |
|
 |
Hi!
I´m trying to capture key messages from within a prop page.
What I did is to put an OnkeyDown message handler in the page where I wish to capture the key from. But it doesn´t work.
I used this method in a the view of a Document View App and it worked fine.
How does the property sheet deal with this kind of messages.
Do I have to disable all the controls within the page?
thanks in advance.
Daniel Cespedes
"There are 10 types of people, those who understand binary and those who do not"
"Santa Cruz de la Sierra Paraiso Terrenal!"
daniel.cespedes@ieee.org
|
|
|
|
 |
|
 |
I didn´t want to post this question here, I made a mistake.
Daniel Cespedes
"There are 10 types of people, those who understand binary and those who do not"
"Santa Cruz de la Sierra Paraiso Terrenal!"
daniel.cespedes@ieee.org
|
|
|
|
 |
|
 |
Greeting is a Chilean programer,
My consultation is the following like I could print an image in Visual Basic 3.0, I have succeeded it in carrying out 6.0 in Visual Basic but I need it in VB30 from already thanking the aid
thank you
|
|
|
|
 |
|
 |
Greeting is a Chilean programer,
My consultation is the following like I could print an image in Visual Basic 3.0, I have succeeded it in carrying out 6.0 in Visual Basic but I need it in VB30 from already thanking the aid
thank you
|
|
|
|
 |
|
 |
I have a main program written in Visual Basic and its related DLL written in Visual C++. The main program calls an exported function of the DLL to store the address of a callback function in the main. Now, if the DLL creates a thread and this one
calls the callback, an error message "...Access Violation..." occurs.
If the DLL calls the stored callback, from a timer event for example, it works well.
I need to call the stored callback from one or more threads inside the DLL.
I ask to you your help
Thank you very much
Paolo Zaia
******************** Visual Basic Code *******************
********* Module .bas declaration **********
Public Declare Sub PassCallback Lib "TimerTest.dll" (ByVal CallBackFunc As Any)
Public Sub CallBackFunc(ByVal PARAM1 As Long)
MsgBox "Hello Callback (" & PARAM1 & ")"
End Sub
********* Form Main **********
Private Sub cmdButton_Click()
call PassCallback(AddressOf CallBackFunc)
End Sub
******************* Visual C++ Code ********************
******** Modulo .def **********
LIBRARY MultiThreadTest
EXPORTS
PassCallback
******** Modulo Main.c ********
#include
#include
void (_stdcall * CallBack)(DWORD);
UINT TimerRef, ThreadTimerRef;
VOID CALLBACK Timer2Proc( HWND hWnd,
timer messages
UINT uMsg,
UINT idEvent,
DWORD dwTime )
{
KillTimer( NULL, TimerRef );
CallBack(1); // It works well
}
DWORD WINAPI ThreadOne( LPVOID lpvParam )
{
CallBack(1); // Crash !!! --> Help me, please
return 0;
}
void _stdcall PassCallback( void (_stdcall * CB)(DWORD) )
{
CallBack = CB;
CallBack(1); // It works well
TimerRef = SetTimer( NULL, NULL, 1000, (TIMERPROC)Timer2Proc );
DWORD dwThreadID;
HANDLE hThreadHwnd;
hThreadHwnd = CreateThread( NULL, 0,
ThreadOne,
(LPVOID)0, 0, &dwThreadID );
WaitForSingleObject( hThreadHwnd, dwThreadID );
CloseHandle( hThreadHwnd );
}
|
|
|
|
 |
|
 |
Read this, I spent many hours to find the answer on this question long time ago http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q198607&
|
|
|
|
 |
|
 |
does this mean you cannot call callbacks from spawned threads within your DLL?
the article says this isnt currently supported.
when i call my callback (from a thread), it crashes rite away with the exception violation. but if i call the callback from the main dll thread, it works.
thanks
reece
|
|
|
|
 |
|
 |
Yes, you can't call callbacks from any other thread in VB, even if you will create this thread in VB code by API call CreateThread. Sometimes it will work if you will not change any UI controls, but you will not be able to debug callback in VB - it will crash always... I don't know why.... I recommend you to create some invisible window (or subclass any control on VB form) and call events via custom defined window message, something like:
LRESULT CALLBACK CallbackWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_VBEVENT:
VBEvent();
break;
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
return 0;
}
|
|
|
|
 |
|
 |
thanks for the reply! my situation is a little different, however.
My DLL is a c++ DLL.
its a c++ object which gets instantiated from VB.
that main thread, spawns a thread using CreateThread.
it is from that thread that i need to call the visual basic callback.
if i call the callback from the main thread, its fine.
if i call it from the thread that was spawned, i get the access violation.
am I only allowed to call the VB callback from the main DLL thread?
thanks!
|
|
|
|
 |
|
 |
Hi
I have the same problem- I created vc++ dll which captures signal from soundblaster. The callback function is called in separate thread inside dll.
I get the next error:
The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
Is it possible to overcome this problem?
I tried to use the same dll with code written in VC++ and it works with no problem at all.
My source looks like this:
VB:
Public Delegate Sub Callback(ByVal size As Int32)
Public Declare Function RecToR_Init_Cap Lib "RecToR_Cap_TR.dll" (ByVal CalBckFunc As Callback) As Int32
Dim cb As Callback
cb = AddressOf CallBackFunc
Success = RecToR_Init_Cap(cb)
Public Sub CallBackFunc(ByVal size As Int32)
TextBox1.Text = TextBox1.Text & size & vbCrLf
End Sub
VC++:
void (*Razpoznano_M)(int_4 size);
__declspec(dllexport) WINAPI RecToR_Init_Cap(void (*tmp)(int_4 size)){
Vmesnik.Razpoznano_M = tmp;
return (int_4)ANGE_OK;
}
Function Razpoznano_M is called in separated thread.
Tomaz Rotovnik
|
|
|
|
 |
|
 |
Hi,
Please see following example:
// Delphi Source code for Project1.DLL
library Project1;
uses
SysUtils,
Classes,
Dialogs;
function Divide(a,b:Double):Double; stdcall; export;
begin
this I allocate virtual Memory
Result:=0;
try
Result:=a/b;
this I free allocated Memory
Except
ShowMessage('Kill me if you will see this message in
VB ');
this I free allocated Memory
end;
end;
exports Divide;
begin
end.
Public Declare Function Divide Lib "Project1.DLL" (ByVal a As Double, ByVal b As Double) As Double
Private Sub UserForm_Initialize()
On Error Goto ErrorHandler
MsgBox Str(Divide(1, 3))
MsgBox Str(Divide(1, 0))
Exit Sub
:ErrorHandler
Call MsgBox(Err.Number, Err.Description)
End Sub
Now I can handle the error message, but I CANNOT free allocated Memory because the execution control is passed to VB when an exception is raised.
It is means that this block
this I free allocated Memory
Except
ShowMessage('Kill me if you will see this message in
VB ');
this I free allocated Memory
end;
never runs in this case .
Remark that it is not depend of programming Language of DLL Source.
I suppose that we cannot catch exception in DLL which is
used in VB. Let us considerate that double a, double b and
double c are in DLL. Source line c=a/b from DLL can raise
an exception, if b=0. I suppose the main program will die
in this case. The VB projectants resolved this situation
by non supporting exception catching in DLL ( the main property of VB is that never die ).
Is this right?
|
|
|
|
 |
|
 |
I'm very new in VB, and I need help with the Declaration part of the code. what I'm doing is trying to call funcions, methods, or events within a DLL called RackCLS.dll. Any information would be greatly appriciated.
Thanks
|
|
|
|
 |
|
 |
Hi
If you are created the dll as a ActiveX DLL, use the following steps,
Goto the Project->references
Select the DLL reference from the list.
In your code declare as,
Dim objRack as new RackCLS
then,
Use the objRack to call the members of the dll.
HTH.
GTS
|
|
|
|
 |
|
 |
mail me sriniwas_m@yahoo.co.in...24 m chennai
|
|
|
|
 |
|
 |
I am using a dll in vb code. Its working fine in win 2k but not in win nt. What to do????
|
|
|
|
 |