|
Thank you Viorel!
Why using static lib is not workable, but using DLL file is workable? What is the internal reason (linker compiler level reasons)?
regards,
George
|
|
|
|
|
In my opinion, the DLL files create by newer VS, in contrast with *.lib files, can be used in various operating systems and with different executables. When an executable requires a DLL function, it executes LoadLibrary and then GetProcAddress . Since these Windows functions can work with DLL created by both VC6 and VS 2003, in this way it seems to be possible to use a newer DLL by older executables.
|
|
|
|
|
Hello again Viorel
Viorel. wrote: In my opinion, the DLL files create by newer VS, in contrast with *.lib files, can be used in various operating systems and with different executables.
Why DLL works but .lib does not work? There must be some internal (compiler/linker level) reasons, agree? What are the internal reasons?
Viorel. wrote: Since these Windows functions can work with DLL created by both VC6 and VS 2003, in this way it seems to be possible to use a newer DLL by older executables.
What do you mean "these Windows functions"? Do you mean LoadLibrary and GetProcAddress?
regards,
George
|
|
|
|
|
George_George wrote: There must be some internal (compiler/linker level) reasons, agree? What are the internal reasons?
Maybe the binary format of LIB files was changed for certain reasons, like new language features. I do not know if it is possible to force a lower linker level.
George_George wrote: LoadLibrary and GetProcAddress?
Yes.
|
|
|
|
|
Hi Viorel,
I am looking for solution at compiler/linker option level to solve the compatibility issue. Because in my application, using static library is better than using DLL. Any comments or ideas?
regards,
George
|
|
|
|
|
|
Thank you Viorel!
This forum is very cool.
regards,
George
|
|
|
|
|
|
Thank you Mike!
I have tried it just now and it works! Cool! I have a further question, about .DLL files, I think they should be both forward-compatible and backward-compatible, right? I mean if I create a DLL in VC7 and it could be used with VC6 and vice versa.
regards,
George
|
|
|
|
|
|
Thank you Mike!
I just can not belive why DLL can be used together even if they are not compiled/linked by the same compiler/linker, since I think there is no binary file standards between different compiler/linker, right? But I know that we can build a DLL and let even VB or Delphi utilize it.
What is the reason?
regards,
George
|
|
|
|
|
The problem isn't DLLs, it's C++ name decoration. The standard does not define a standard decoration scheme. So if 2 compilers, or 2 versions of a compiler, use a different scheme, their LIBs won't be compatible.
That's why many APIs are exposed from DLLs using extern "C" (no decoration at all) because that's the lowest common denomiator that all compilers can understand and use.
|
|
|
|
|
Hi Mike!
I do not think using extern C can bring us all the benefits (DLL can be used across different linkers, for example, VC and VB), but it can also bring us trouble, for example, we can not use function overloading in C++ when we use extern C since C does not have function overloading. Right?
regards,
George
|
|
|
|
|
hello
yesterday i was getting Assertion error when i try the following code :-
void CTESTsipXtapiDlg::handleOffering(SIPX_CALL hCall)
{
sipxAudioEnableSpeaker(g_hInst,SPEAKER);
char cCallId[512];
sipxCallGetID(hCall, cCallId, sizeof(cCallId));
SetDlgItemText(IDC_Message,"New Call");
}
but today its not givingme any assertion error but not displaying any message in text box.
plz help me.
i'm stucj here
|
|
|
|
|
In certain situations the following fragment helps:
SetDlgItemText(IDC_Message, "New Call");
GetDlgItem(IDC_Message)->RedrawWindow();
Perhaps this is what you need.
|
|
|
|
|
hello
thanx
but
when i use these statement in the function then it hangs the system.
plz help me i'm not getting any proper solution.
why m_hWnd value got NULL?
what should be solution for it.
byeee
|
|
|
|
|
|
sir in setdlgitemtext function.
it gots NULL and does not show any message in the dialog box control.
|
|
|
|
|
how to declare idc_message and i need to see your code for answer to you
whitesky
|
|
|
|
|
it just control id.
from .rc file.
which type of code u want i will show u every thing.
byee
|
|
|
|
|
You can declare a variable for this control
whitesky
|
|
|
|
|
I have Declare a variable for it but i'm not getting what code should i write for it.
becoz i haven't use this before could u guide me to further steps or Code Lines.
|
|
|
|
|
Its one idea try this code and answer to me
<br />
#define IDC_EDIT 1000<br />
<pre><br />
CEdit m_Edit;<br />
m_Edit.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,200,23),this,IDC_EDIT1);<br />
and use this code instead your id like "m_Edit.SetWindowText();"<br />
answer to me
whitesky
|
|
|
|
|
when i use this code then it give me error "unsupported opertaion was attempted".
and here we don't have code to show the message in text box too.
|
|
|
|
|
if you run this you get a editbox in left corner window
HWND hWnd;//declare is Global
<br />
hWnd=CreateWindow("EDIT","",WS_CHILD|WS_VISIBLE,0,0,150,23,m_hWnd,NULL,AfxGetInstanceHandle(),NULL);<br />
::SetWindowText(hWnd,"Test");<br /> and where you use this code (which function)
whitesky
|
|
|
|