0

I'd like to use a global variable(fileposition) in C++ as following.

the fileposition is get from OnDropFile().

When I got a fileposition as following, the fileposition value are changed after display as well.

I don't know the reason.

char * fileposition;

...



::OnDropFile()

{

...
MAX_PATH = 260;

char szPathName[MAX_PATH];

::DragQueryFile(hDropInfo, 0, szPathName, MAX_PATH);

fileposition = szPathName; // 

global_TestView->DoDisplayImage();

...

}

TESTVIEW.cpp

void CTestview::DoDisplayImage(void)
{
...

m_Image.read(fileposition);
...
}

update

I don't know someone told me this question is duplicated. but I don;t know what should I do for solving this. Would you please help me ?

cabot
  • 73
  • 1
  • 7

0 Answers0