|
COM components are loaded via CoCreateInstance [^].
If you need to use an ActiveX control and you're writing an MFC application, Visual Studio may create a wrapper for you: choose Project->Add Class menu item and then select MFC Class From ActiveX Control (at least on VS 2005 ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
To understand this better, let's look at a simple example: Suppose I have a VB ActiveX DLL with a class called Test, which has a method called
TestItOut(). You can create the object and call the method like this:
#import "test.dll" no_namespace named_guids
_TestPtr pTest = 0;
HRESULT hres = pTest.CreateInstance ( __uuidof(Test) );
pTest->TestItOut();
|
|
|
|
|
hi
thanks yar...i want some information...
#import "test.dll" no_namespace named_guids // this is given compilation error
please help me friend....
|
|
|
|
|
can u please help any body how to call vb dll in vc++
i MY VB DLL IS mydll.dll
#import "c:\mydll.dll" // this is given compilation errors
or
typedef CString (WINAPI*ifunc)(CString str);
INCREMENTFUN pIncrement;
HINSTANCE hLib;
hLib = LoadLibrary("..\\scdthndl.dll");
pIncrement = (INCREMENTFUN)GetProcAddress((HMODULE)hLib, "StringToCSV"); // here its giving pIncrement = 0x0000000
any one can help me....
|
|
|
|
|
Firstly, if you're using GetProcAddress the function should be exported from the DLL. Check with something like depends[^].
#import is for type libraries. Using this implies that the method is exported using COM, in which case GetProcAddress will not work.
Steve
|
|
|
|
|
hi
i have vb activex dll...i want to use vc++...please help me....
HINSTANCE hLib;
hLib = LoadLibrary(c:\scdthndl.dll");
pIncrement = (INCREMENTFUN)GetProcAddress((HMODULE)hLib, "StringToCSV");
pIncrement is giving 0x000000..
|
|
|
|
|
As I told you before, verify the function is exported.
Steve
|
|
|
|
|
Member 3653751 wrote: c:\mydll.dll
Member 3653751 wrote: scdthndl.dll
Why different names?
Member 3653751 wrote: pIncrement = (INCREMENTFUN)GetProcAddress((HMODULE)hLib, "StringToCSV"); // here its giving pIncrement = 0x0000000
Afterwards, you should call GetLastError() to obtain more info.
Did you check what is the exported function name (you may use, for instance, the Depends tool)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
sorry.... by mistake i typed scdthndl.dll...if i give mydll.dll also same problem....
can u please help
i want use vb dll in vc++
|
|
|
|
|
Did you check the exported function name?
Do you read the suggestions (mine and of the other folks?)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
i checked exported function name....it is correct only...
but its giveing NULL....
|
|
|
|
|
Why didn't you call, as suggested, GetLastError ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
the other comments are fully right to call the dll.
But for string parameter you should use BSTR type. An article with basic explanations:
Guide to BSTR and C String Conversions[^]
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Check whether scdthndl.dll is loaded, means hLib is having value or it is also 0?
Величие не Бога может быть недооценена.
|
|
|
|
|
hi
hlib have value...GetProcAddress() only Null coming
please give me any suggestions....
|
|
|
|
|
Then surely StringToCSV is not an exported function from that DLL
check the depedency of the DLL, check if StringToCSV is shown in Exported functions.
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi, i already implement 4 of wizard page by using 2 dialog.(Exp: page 1 = dialog1, page 2 = dialog2, page 3 = dialog 1, page 4 = dialog 2)
The problem now is i cannot assign the title for every wizard page. Anyone can help?
|
|
|
|
|
SetWindowText in OnSetActivePage()
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
hi
i m using CeGetDeviceId();for finding device id
this return 0,while device is existing.
please help me for this.
thanks in advance.
|
|
|
|
|
Hi All
I am using list control(report style) in formview.
I am trying to insert the columns in OnCreate (or) Show Window Function.
But Neither Works ..
Any Way to Solve it.
Regards
Gany
|
|
|
|
|
How you are doing..plz insert code!
|
|
|
|
|
m_listctrl.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
CRect rect;
m_listctrl.GetClientRect(&rect);
int ctl=rect.Width()/10;
m_listctrl.InsertColumn(0,"ORDERNO",LVCFMT_LEFT,ctl);
m_listctrl.InsertColumn(1,"MOLDNO",LVCFMT_LEFT,ctl);
m_listctrl.InsertColumn(2,"OD TYPE",LVCFMT_LEFT,ctl);
|
|
|
|
|
yes its working for me.
Might be width problem, set it manual.
|
|
|
|
|
Hi
While Debugging i m gettin error in
m_listctrl.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
code itself
|
|
|
|
|