|
Hi there,
I had a question.
I just noticed the availability of module definition file *.def. I had a few doubts.
The current scenario:
-------------------------
*The wrapper dll's library and dll is place under the SDK folder. The lib file is included in the project under the visual studio path settings.
SDK -> Wrapper Dll
SDK code:
-------------
#include "wrapper_dll.h"
extern "C" __declspec(dllimport) double TestA(double a, double b);
Wrapper DLL Code:
------------------------
#define extern "C __declspec(dllexport)
EXTERN double WINAPI TestA(double a, double b);
When you built in into a dll, when you view the dll dependecies, you will notice this (example):
Ordinal = 1 (0x0001)
Hint = 0 (0x0000)
Function = _TestA@20
EntryPoint = 0x0000101E
*The build dll, lib and header file is past to the SDK team to call it.
============================================================
Now, I want to implement def file:
SDK (cannot modified, coz done by someone else and different team) but it still calls the Wrapper dll.
SDK code (same with on top):
-----------------------------------
#include "wrapper_dll.h"
extern "C" __declspec(dllimport) double TestA(double a, double b);
New Wrapper Dll code:
---------------------------
wrapper_dll.cpp:
double TestA(double a, double b)
{
return a + b / 10;
}
wrapper_dll.h:
#pragma once // what does pragma means anyway?? any idea???
double TestA(double a, double b);
wrapper_dll.def:
LIBRARY Wrapper_Dll
EXPORTS
TestA
Now, when i view this dll dependencies, it appears to be like this:
Ordinal = 1 (0x0001)
Hint = 0 (0x0000)
Function = TestA
EntryPoint = 0x000128A7
*problem is the Function name is changed, entrypoint number is change... will this cause problem for the SDK when calling.
============================================================
I need to make sure SDK should be recompiled. I just have to replace the new wrapper dll, lib and .h into the existing files that is part of the SDK folder.
Should i be using def or not def? The current old code is using no def file. Means the sdk will have __declspec(dllimport) and the wrapper will have __declspec(dllexport), and the #include "Wrapper_dll.h" is still part of it of the sdk.
Please help! Module definition file is indeed easier for us as a coder to code. But i just want to see what is the advantages of using def over the others.
Thanks.
Regards,
Chua Wen Ching :p
|
|
|
|
|
Hail again,
If you provide .dll, .lib and .h that means you link to a DLL implicitly and you don't need .def file then. Using a module definition file makes sense only if you want to find function entry point during run-time by using GetProcAddress and referencing a function by an ordinal rather than a name.
|
|
|
|
|
Hi Everybody
I have to display the tiff format files in my MDI application,How can i load them and display in my current document.?and
How to convert TIFF into BMP format.
I am greatful to those who provides plugin to these tasks.
Bye
Mahatma_cis
|
|
|
|
|
Have a look to this article[^], you should find there all the info you need.
HTH, K.
Собой остаться дольше...
|
|
|
|
|
use the gdal library
http://remotesensing.org/gdal/
swandream
|
|
|
|
|
Hi everybody,
I want to use extra API (Named AddText.api) with my Visual C++ Application. can u tell me how to import methods in API to my Program.
thanks....
|
|
|
|
|
How can i create two threads for the same application while running
it is like this,
from one application create one threds of application.
within that application with menu handler call another thread of another application but they both run for the diffent functions at the same time.
uma
|
|
|
|
|
You can use SendMessage() and PostMessage() to send messages from one application to the other. Keep in mind, however, that it is not a trivial task of finding a window given a process id (i.e., that which is returned by CreateProcess() ).
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
hi,
i got an MDI app using Doc/View.
i want to override the [x] system close button.
i tried to override the OnClose() but the program never gets there when i press the [x] button.
i tried debug and to put msgbox's but it doesnt work.
any idea?
|
|
|
|
|
You should handle WM_SYSCOMMAND
with wParam == SC_CLOSE
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
i overide the function in my View but its never gets there.
i did this -
<br />
ON_WM_SYSCOMMAND()<br />
<br />
and...<br />
<br />
void CMyView::OnSysCommand(UINT nID, LPARAM lParam)<br />
{<br />
AfxMessageBox("closing!");<br />
<br />
CFormView::OnSysCommand(nID, lParam);<br />
}<br />
<br />
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);<br />
but the program never gets there when i press the [x] button.
do u know why??
|
|
|
|
|
Can you disable/hide or delete the [x] button?
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hello people,
I wanted to ask how to make a front page like contianer. Where one can place not only activeX controls but also write plane text, make hyper links and make text bold etc.. Actualy this functionality is there if you use CHtmlView as you View class and CHtmlDoc as your doc class, but then u cannot insert activeX control in it... cause for making a container u need to derive from ColeDocument. Can anyone tell me how to do this.
|
|
|
|
|
i have a menu with minimize,maximize and restore and they work but i cant figure out how to resize the controlls when i maximize or restore the dialog i need help
|
|
|
|
|
USE Window MEssage
ON_WM_SIZE();
this will help u in above cause
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
HI ,,
I m Storing Value in Registry as String Value
in Windows 2000 / XP its store string value without double qoutes"" as... value
but in Window 98 it Save String Value with in qoutes... "value"
then after query a value then i try to mathc it but there is missmatch in Windows 98 due to " .." .
y any solution.
thanx
|
|
|
|
|
hian don't mind,i think you are wrong.
i am working on registry i have never this problem which you stating.
anyway what are using raw API's
or <atlbase> CRegClass
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
HI i m using CRegKey Class.... and its methods for query etc.
Can u send me any code sampl ,, that can work on both
win 98 and win 2000/ XP
but if u see using regedit command too see registry values
in windows 98 .. or 2000/ Xp.
check there any registry value that is string value
in win 98 its as "value" but in XP and 2000 its as value simply without qoutations"".
thanx
|
|
|
|
|
IS your Problem Solved
-----------------------------
"I Think It will Work"
Formerly I AM Known As "Alok The Programer"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I think the Problm in Query to the key
here
CRegKey reg;
CString str = "cam";
BOOL bRetVal;
CString strTmp = "Software\\NDT\\Fovea";
bRetVal = reg.Open (HKEY_LOCAL_MACHINE ,(LPCTSTR)strTmp ) ;
if (bRetVal==ERROR_SUCCESS)
{
CString key = "Password";
char getValue[256] ;
DWORD d;
bRetVal=reg.QueryValue ( getValue , (LPCTSTR)key , &d);
if (bRetVal==ERROR_SUCCESS)
{
AfxMessageBox(" Working fine");
CString check = (CString)getValue ;
AfxMessageBox( "Value is ....||"+ check);
if (str.Compare (check) == 0)
{
AfxMessageBox( "Same");
reg.Close ();
}
else
{
AfxMessageBox( "Not same");
reg.Close ();
}
}
else
AfxMessageBox(" Query Failed");
}
else
{
AfxMessageBox( "Cannot Open");
reg.Close ();
}
It is messaging Query Failed..
|
|
|
|
|
I think the Problm in my Query to the key
here
CRegKey reg;
CString str = "cam";
BOOL bRetVal;
CString strTmp = "Software\\NDT\\Fovea";
bRetVal = reg.Open (HKEY_LOCAL_MACHINE ,(LPCTSTR)strTmp ) ;
if (bRetVal==ERROR_SUCCESS)
{
CString key = "Password";
char getValue[256] ;
DWORD d;
bRetVal=reg.QueryValue ( getValue , (LPCTSTR)key , &d);
if (bRetVal==ERROR_SUCCESS)
{
AfxMessageBox(" Working fine");
CString check = (CString)getValue ;
AfxMessageBox( "Value is ....||"+ check);
if (str.Compare (check) == 0)
{
AfxMessageBox( "Same");
reg.Close ();
}
else
{
AfxMessageBox( "Not same");
reg.Close ();
}
}
else
AfxMessageBox(" Query Failed");
}
else
{
AfxMessageBox( "Cannot Open");
reg.Close ();
}
It is messaging Query Failed..
|
|
|
|
|
Here is your Problem
Zeeshan Bilal wrote:
CString key = "Password";
char getValue[256] ;
DWORD d;
bRetVal=reg.QueryValue ( getValue , (LPCTSTR)key , &d);
remeber one thing,QuerryValue Third Parameter containing values goes Both IN and Out so if you want to run your Program properly change DWORD d; to DWORD d=255;//one space for null character
->Basically when the function is Called, the DWORD value Must contain the buffer size of string (which is going in as Second parameter for fetching required Value).
->when function return it contain the value for Total data in second Parameter Return .
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
hi,
how do i determine if the contents of the dialog are changed from the initial values. i have edit boxes, check boxes, etc. after initialization of the dialog with the default values, how do i determine if the contents of the dialog are changed?
|
|
|
|
|
For editboxes you call GetModify (or send EM_GETMODIFY if you are not using MFC). Otherwise, you'll have to do it manually.
|
|
|
|
|
Most controls have a sort of OnChange Handler or OnClick...
Right click the control and choose "add event handler".
If something changes in your edit box you can check it against the original value.
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|