Problem of calling function - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Problem of calling function

ShivaniShivani Posts: 20Member
[b][red]This message was edited by Shivani at 2003-7-18 3:54:8[/red][/b][hr]
Problem is that from the main program(MAIN) i'm calling a function(abc()) which is in dll (PQR.dll)...CPQR is a class derived from CDialog. Now in PQR dll func abc() is defined & from abc() i'm calling another function xyz() which is also in PQR dll.

PQR.dll

extern "C" __declspec(dllexport) void abc()
{
xyz(); // if called like this it gives an error..undeclared identifier.

CPQR obj;
obj.xyz();

//if called in this manner it does not give any error while compiling but while excuting "An unsupported operation was attempted" error is shown.

}

void CPQR :: xyz()
{
--------
--------
}

How do i call xyz() func from exported function abc().


Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    : [b][red]This message was edited by Shivani at 2003-7-18 3:54:8[/red][/b][hr]
    : Problem is that from the main program(MAIN) i'm calling a function(abc()) which is in dll (PQR.dll)...CPQR is a class derived from CDialog. Now in PQR dll func abc() is defined & from abc() i'm calling another function xyz() which is also in PQR dll.
    :
    : PQR.dll
    :
    : extern "C" __declspec(dllexport) void abc()
    : {
    : xyz(); // if called like this it gives an error..undeclared identifier.
    [red]The above is obviously wrong because there is no such function in global namespace.[/red]

    :
    : CPQR obj;
    : obj.xyz();
    [red]Depending on what xyz() does, this will not work either because CPQR is derived from CDialog and the m_hWnd member is still NULL at that point. You can not access any of the dialog's controls at this time.[/red]


Sign In or Register to comment.