|
I've created a DLL but how can I call all my functions in that DLL from an EXE?
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
MFC or ATL?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Well, I want to do it with Win32 or MFC.
Can you show me in Win32, do that!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
So you mean you use Win32 Dynamic-Link Library project ro write dll?
So first as you now you have to register your dll.
include your yourdll_idl.h and yourdll_idl_i.c in your class,then you can use your methos:
Is that enough or you need more?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
1) Add lib file produced by DLL project to exe project: Project - Settings - Link - Object/library modules
2) Include exported h-file to your exe project
3) Call Dll functions
4) Ensure that Dll is available in runtime via PATH.
|
|
|
|
|
Hello, the codegurus around the world.
There are at lease two ways to call the functions in DLL.
One is to use LoadLibrary and GetProcessAdoc(?) to get
the address of the function in DLL.
The other way is to implicity call the function in DLL
by registering the function name in DLL at def file.
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
Aah!
The first way you said was exactly what I was looking for!
I post a new message if I get some trouble with the functions... thnx
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Well, I have a question right now:
What kind of type will my varible that holds the address have?
I can't declare a:
FARPROC myfunc = GetProcAddress(....);
and then call my function:
myfunc();
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Declare a function pointer that has the same prototype of the function that you want to call:
Example:
<br />
int GetWindowText(HWND hWnd, LPTSTR lpString, int nMaxCount);<br />
<br />
int (*GetWindowTextPtr)(HWND, LPTSTR, int);<br />
<br />
FARPROC myfunc = GetProcAddress(....);<br />
<br />
GetWindowTextPtr func = (GetWindowTextPtr)myfunc;<br />
<br />
myfunc(hWnd, szString, count);<br />
|
|
|
|
|
Hey guys i am writing a quick bit of software for my electronics that converts a bitmap to pure binary ie puts the first line at the begginning and removes the bitmap header. I wanted to display this datd again in the software so i could check the image being stored but i can't seem to find a control that lets me to turn a pixel on or off or has a grid where i can make each cell balck or white.
Basically what i need to do is have a grid of 256x256 where i can control each pixel to be white or black so on or off.
Cheers
Peter
|
|
|
|
|
Hello,
I'm looking for the Liposuction32 tool (http://www.microsoft.com/msj/defaulttop.asp?page=/msj/archive/s572.htm). The link has been removed from the article...
If anyone has it..
Thanks
|
|
|
|
|
This link has it.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi!
I am writing UNICODE application. Everything works fine, apart from list boxes. When I add russian/japaneese string to the listbox I receive garbage in dialog. It works ok for english. It seems to me that CLIstBox does not handle properly UNICODE strings.
I also tried:
LCID mylcid = MAKELCID(MAKELANGID(LANG_RUSSIAN, SUBLANG_NEUTRAL), SORT_DEFAULT);
m_theListBox.SetLocale(mylcid);
_ASSERTE(m_theListBox.GetLocale() == mylcid);
and I get assertion.
Does anyone know, how to put russian/japaneese string into the list box?
(I am using WindowsXP Pro)
Thanks in advance
|
|
|
|
|
Make sure the control's font is set to something that supports the character sets you're using, such as Tahoma. If it's MS Sans Serif, the non-Latin characters will not show up right.
--Mike--
Fetchez la vache!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
Hi
I need some code that stops my program from loading up the mainframe when it is starting. Because I want it to wait while my splash-screen is showing. Is it possible?
Thanks
|
|
|
|
|
Take a look at CYourApp::InitInstance() . This is the appropriate place to inject a splash window and wait for it to terminate before proceeding with the rest of the program.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You can create non-modal splash window just at very beginning.
Proceed with application initialization, and then terminate splash dialog. You can also set a timer.
This will not block application when splash screen will be displayed.
|
|
|
|
|
I think you can set timer!
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I am trying to debug my program because while running my driver program i encounter a bug and the error that the computer tells me is this:
" Unhandled Exception in Tictactoe.exe: 0x000005: Access violation"
this error occurred in my destructor for my CBoard Class
CBoard::~CBoard()
{
delete mpDefaultPen; <-- what is causing a exception to be thrown?
}
oh i used this pointer in my function
// Changes the Line color to the value entered
void CBoard::SetLineColor(CDC* pDC, COLORREF color)
{
// Sets color to mLine color
mLineColor= color;
// Construct a pen
mpPen = new CPen;
VERIFY(mpPen);
VERIFY(mpPen->CreatePen(PS_SOLID,5,mLineColor));
VERIFY(mpDefaultPen = pDC->SelectObject(mpPen)); <-- rite here
}
Does anyone know whats causing this bug to occur? anyways... thank you in advance for helping me... i very much appreciate all the help
|
|
|
|
|
You shouldn't delete mpDefaultPen , but rather select it back to pDC with SelectObject once you're done with the DC object. Check your documentation for SelectObject . The general scheme is as follows:
mpDefaultPen =pDC->SelectObject(mpPen);
pDC->SelectObject(mpDefaultPen);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
oh ok thank you Joaquin for the help. i forgot, i didnt create mpDefaultPen so i shouldnt delete it or it will cause me an error (i forgot what kind of error that is -- i think its the dangling pointer problem). again thank you for your help muchas gracias para me ayudarle is what is said right??
|
|
|
|
|
muchas gracias para me ayudarle is what is said right??
It's close. The correct sentence would be "Muchas gracias por ayudarme". You are welcome.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Will MFC programs written with VC++.net work for older platforms like Windows 98? Or I would have to distribute the MFC7 libraries? I'm having trouble getting things to run. Please help a newbie
|
|
|
|
|
David Z wrote:
I would have to distribute the MFC7 libraries?
yes,you have to distribute it
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Thanks for the reply! Just one last thing, will the .net Framework be enough? or i'd have to distribute the individual .dlls?
|
|
|
|