|
Are you exporting the C++ class from the DLL?
If so, the member function names are mangled and exported.
Use a tool like depends.exe that comes along with Visual Studio and look at the exported function name.
Use the same name in your VB code.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
thanks for your reply. i didn't export. how to export it? i got .DLL only with object file library. as well as documentation. thanks
|
|
|
|
|
Read the documentation for Exporting from a DLL[^]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
thanks a lot. i have read the articles how to export functions names in .dll. but this .dll was created by user. so here i just got .dll. nothing else, so how to export the function names? thanks.
|
|
|
|
|
Do you mean somebody else has created the dll and not you?
If so, the functions have already been exported.
Use Dependency Viewer (depends.exe) and open the dll file.
It will list all the functions that have been exported.
Check the actual name of the function and use that in the VB code.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
yes, somebody already created the .dll, i just would like to use it. so how i can use these function directly? also one library has several classes, how to use it properly? thanks..
|
|
|
|
|
my code is following:
Private Declare Function DataFormat Lib "icon_vc80_40d.dll" (ByVal cpIpAddress As String, _
ByVal dnsFlag As Boolean) As Boolean
Private Sub Command1_Click()
Dim a As String
Dim b As Boolean
Dim c As String
a = Text1.Text
c = DataFormat(a, True)
Text2.Text = c
End Sub
i used this code to test the .dll, but the error occurred: didn't find .dll file. or couldn't find entry point of .dll. what is problem?
Note: ICON_API icon::DataFormat::DataFormat ( const DataFormat& df,
bool cloneComponents = true
)
Copy constructor.
Parameters:
[in] df DataFormat object to copy.
[in] cloneComponents Specifies if a deep or shallow copy is made.
Thread Safety:
Not thread safe. The data being copied can change at any time.
could you help me to check, is this right? the Note above just showed dataformat() detail.
modified on Thursday, May 14, 2009 2:46 AM
|
|
|
|
|
I made a suggestion twice in my earlier posts.
Please look at that.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
thanks a lot, i have documentation of .dll, so i know the actual function name, is this right? sorry, i dun know more this point. now i used the code to test one function DataFormat() what i posted in previous reply. so the error occurred: file not found: icon.dll. so what is problem? and also i have several classes in one library, how i can call the functions properly?thanks.
rdgs
|
|
|
|
|
dear friend
i have downloaded the Dependency Viewer software and installed it, however i just could get the .dll in .exe file. so can't get export funcions. any problem? thanks a lot
|
|
|
|
|
Open the .DLL file in dependency viewer and look at the right hand side pane.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
however i couldn't open it. software just reminded me to choose type which will be open, after that, just showed me how many dll. i downloaded dependency viewer 1.0. what is problem i made. thanks.
|
|
|
|
|
zhiyuan16 wrote: so how to invoke the c++ member function in one .dll
I guess only c functions exported from the dll can be called from VB.
|
|
|
|
|
thanks for your reply. i knew i need to export the c++ dll function first, and then i can call it. but i don't know how to export step by step? i got the dll already. how to export? please help me. thanks a lot
rgds
|
|
|
|
|
You can call a c function exported in a c/c++ dll from a VB application. And to export a c function all you have to do is put the following keywords in front of the function to export as shown below
extern "C" __declspec( dllexport ) void AnotherCFunc();
extern "C" - is used to avoid the name mangling
|
|
|
|
|
thanks a lot for your help. my one .dll has several classes, so how i can use these funtion properly in vb. thanks a lot
|
|
|
|
|
As I said before you cannot call a c++ class's member function from a vb app.
|
|
|
|
|
thanks, how i can export the functions of dll step by step? thanks a lot
|
|
|
|
|
If you haven't DLL source code then you can't. However, you may develop (with C/C++ ) a new DLL that will act as wrapper of the original one (i.e. an adapter [^]). For details on building a VB6 callable DLL , see this great article series [^].
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]
|
|
|
|
|
Hi ,
In my application I am using NOTIFYICONDATA structure to show tool tip. here the szTip can only contain 128 charecter. Is there any other way to use more charecters in tool tip?
Thanks in advance.
birajendu
CyberG India
Delhi
India
|
|
|
|
|
birajendu wrote: Is there any other way to use more charecters in tool tip?
Not using the standard shell32 tooltip. I'm afraid that you will have to use a custom tooltip if you require additional features. There are a few articles here on codeproject which could be used.
CPPToolTip v2.1[^]
Custom ToolTips for MFC Projects[^]
Best Wishes,
-David Delaune
|
|
|
|
|
This may help you
http://www.codeproject.com/KB/toolbars/tooltipsindialog.aspx
|
|
|
|
|
By the way szTip can only contain 64 characters and not 128.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I've got an MFC application writed in c++, it is a dialog-based project. I can't find anywere in the internet a solution for my problem. I've got a dialog window were i created a buttons. Also I've got two others dialog windows. I don't now how to make to open second dialog window when the button in window one will by clicked. I tried everything what i found in the internet and nothing ...
Please if any one can help me. I will be very thankfully if someone can send my or show how to do this.
HrDDD
|
|
|
|
|
in the handler of your button in dialog A (the first dialog), just create the second dialog.
for modal dialog:
void MyDialogA::OnButton()
{
MyDialogB dlg;
dlg.DoModal();
}
for modeless dialog:
class MyDialogA
{
MyDialogB* m_pDialogB;
}
void MyDialogA::OnButton()
{
if ( m_pDialogB)
delete m_pDialogB;
m_pDialogB = new MyDialogB;
m_pDialogB->Create(IDD_DIALOG_B);
m_pDialog->ShowWindow(SW_SHOW);
}
This signature was proudly tested on animals.
|
|
|
|