|
I guess you're not exporting the DLL function that you're trying to call.
Do this in the DLL.
extern "C" __declspec(dllexport) void MyExportedFunction()
{
}
|
|
|
|
|
This is my header file declaration ..
<br />
#ifndef _DLLTEST_H_<br />
#define _DLLTEST_H_<br />
<br />
<br />
#include <stdio.h><br />
#include <windows.h><br />
#include <iostream><br />
<br />
extern "C" __declspec(dllexport) int MyFunction();<br />
#endif<br />
but i dont know why that kind of error coming ..??
Thanks
Raju !!!
|
|
|
|
|
|
This is header file My.h
#ifndef _DLLTEST_H_
#define _DLLTEST_H_
#include <stdio.h>
#include <windows.h>
#include <iostream>
extern "C" __declspec(dllexport) int MyFunction();
#endif
this is my Cpp file
#include "stdafx.h"
#include <stdio.h>
#include <iostream>
#include "My.h"
int _tmain(int argc, _TCHAR* argv[])
{
HMODULE hDll = ::LoadLibrary("My.dll");
MyFunction();
return 0;
}
this kind of way i create the exe sir ..
Raju !!!
|
|
|
|
|
This is not going to work: first, your exe defines the MyFunction as exported. In the exe, you should import the function. If you are using LoadLibrary, you will need to call GetProcAddress in order to retrieve the function.
You could also load your dll implicitely by linking to the lib file generared when you compile your dll, it becomes much easier.
I suggest you start reading some articles about creating and using dll's because you seem to mix a bit everything. Here[^] is a couple of articles about dll's, I suggest you read them (in the correct order of course). Otherwise, I am sure there are plenty of articles on the net if you google a bit about it.
|
|
|
|
|
Thank you sir ..i ll come back with good result ..
Raju !!!
|
|
|
|
|
How did you test your DLL? Are you using LoadLibrary() and GetProcAddress()?
|
|
|
|
|
Sorry for the delay ..sirs..
i am using LoadLibrary function
Raju !!!
|
|
|
|
|
Use the Dependency Walker[^] tool to check if the DLL exports what you want to invoke.
Maxwell Chen
|
|
|
|
|
raju_Code wrote: The procedure entry point xxxxx could not be located in the dynamic link library yyy.dll
What are the "xxxx" and "yyy" ?
How did you create the dll ?
|
|
|
|
|
Dll creation
extern "C"
{
__declspec(dllexport) int MyFunction()
{
DetailFunction();
.................
}
}
xxxx means DeatailFunction();
yyyy means another one dll
Raju !!!
|
|
|
|
|
No, that's just a bunch of code. I asked how did you create the dll ? Did you use the creation wizard ? Is it a MFC dll or a plain dll ? Do you have a DllMain function ?
raju_Code wrote: xxxx means DeatailFunction();
yyyy means another one dll
What do you mean ? Your dll is using another dll ?
|
|
|
|
|
I have linked the dialog with the database bt m nt able to display the data in the edit boxes in the dialog.
Smebody please help with the code...
|
|
|
|
|
You should give more details...
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 database consists of a table named "Manager" having the following fields
"ManagerID"
"Manager Last Name"
"Manager First Name"
there are a total of 7 entries in each field.
I want each field to be displayed in separate edit boxes in dialog.
Have linked the database bt m not able to display the data in dialog.
Please help with code.
Thanks in advance.
|
|
|
|
|
billu 2 wrote: Have linked the database bt m not able to display the data in dialog.
So, if I got you, you made a connection to the database. Now, you know it's just matter of quering the databse for the right data.
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]
|
|
|
|
|
billu 2 wrote: ...bt m nt able to display the data in the edit boxes in the dialog.
First, fix the vowel keys on your keyboard. Second, associate a CEdit variable with each of the edit controls. Then you can use SetWindowText() to set the text within the edit controls.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi...
Now i am having a text file like,
oueyrfdhfdsfdsfkdjfd
dsdysjhdjsydhjshdjksd
sdytytdhsdshdtshdgshd
dsygdhsdjsdgsjhdgsdj
i read this file Using CString variable.
Now i want to delete 3rd line from this file.
What is the synatax for delete a line from file?
G.Paulraj
|
|
|
|
|
Read all the content of that file into a buffer (for example: a std::string or CString ), locate that line (the start pos and the end pos), remove that segment, and write all the modified buffer back to the file.
Maxwell Chen
|
|
|
|
|
To delete a line in a file, you should:
- Read the file in a buffer.
- Discard unwanted characters from the buffer
- Write the buffer content to the file
Using CStdioFile::ReadString [^] helps.
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]
|
|
|
|
|
You cannot delete a line from a file.
You have to write the rest of the lines to a new file.
Then delete the original file and rename the new file to the original filename.
|
|
|
|
|
See a similar question here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Using C++ and WORD APIs, I am saving a html file as .doc.
In html file I have tags, those are link to external files. These images should also get embedded in my DOC file.
However, I could not save the images in the document itself. Is there any way that I can tell Word programatically to save the images in the document itself ?
Any help would be highly appreciated.
Regards,
Paresh.
|
|
|
|
|
Hello Friends
I am creating win32 based application and in this I am using Lots of Dialogs and Tab Change with Buttons.But when I click from one button to another button It is taking too much time around 8 to 9 seconds.
Is any way to make My UI faster ,so that It opens faster.
Thanks In Advance.
Yogesh
|
|
|
|
|
yogeshs wrote: I click from one button to another button It is taking too much time around 8 to 9 seconds.
There must be something wrong with your code...
Maxwell Chen
|
|
|
|