Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.