hi , i use the following code which works fine in Debug mode. AFX_MODULE_STATE *pstMngSt; pstMngSt = AfxGetStaticModuleState(); AFX_MANAGE_STATE(pstMngSt); AfxSetModuleState(pstMngSt); m_hInstance = pstMngSt->m_hCurrentInstanceHandle; But when i use the same in Release version, i get error LNK2019: unresolved external symbol "public: __thiscall AFX_MAINTAIN_STATE2::~AFX_MAINTAIN_STATE2(void)" (??1AFX_MAINTAIN_STATE2@@QAE@XZ) referenced in function "public: void __thiscall CModeMGMT::DispatchDllMsg(struct HWND__ *,unsigned int,unsigned int,long)" Any library file to be included ?? Pls help me.. Thx Sugu
sugumar
Posts
-
error LNK2019 using AFX_MODULE_STATE in Release version -
Accessing a variable from another classthanks for your immediate response and which also solves my problem.Tnahk You Michael
-
Accessing a variable from another classI have 2 class - CUserDlg,CMenuDlg. I collect a string value from CUserDlg and pass/use this value to/in CMenuDlg. I define the variable as Public in CUserDlg and Collect value for it. Public : CString szName; UserDlg.Cpp: szName = "Hai"; CDialog::EndDialog(0); CMenuDlg dlg; dlg.DoModal(); and close CUserDlg screen and calls CMenuDlg screen. I define CUserDlg object in MenuDlg header file. CUserDlg* UserData; And when I access UserData->szName in CMenuDlg.Cpp file, i get only NULL value. Pls help me out.
-
CString to const char* conversionstill problem continues.I put the code for ur ref. CStringArray* aXMLfiles; int mlen,j; CString filename; FILE *fptr; aXMLfiles = GetFileNames("*.XML"); /// This function retrives me all XML files.. mlen = aXMLfiles->GetSize(); for(j=0;jGetAt(j); fptr = fopen( ( LPCTSTR ) filename, "r" ); if (fptr != NULL){ // do something } } fopen' : cannot convert parameter 1 from 'class CString' to 'const char *' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called.
-
CString to const char* conversionm_fileName is CEdit type. Also i hv to collect string value from CstringArray like this.. CStringArray* aXMLfiles; CString filename; int mlen = aXMLfiles->GetSize(); // write all the XML files for(j=0;jGetAt(j); LPTCSTR lpszString = filename; fptr = fopen( lpszString, "r" ); ////do something//// } still i get error.
-
CString to const char* conversionCString is not able to be assigned with LPTSTR, LPTSTR lpszString = filename; gives error error C2440: 'initializing' : cannot convert from 'class CString' to 'unsigned short *' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
-
CString to const char* conversionI need to convert CString value to const char *. I do the same in following way. I also tried with LPCTSTR, still i get same error. CString filename; FILE *fptr; m_fileName.GetWindowText(filename); int nLen = filename.GetLength(); LPTSTR lpszString = filename.GetBuffer (nLen ); fptr = fopen( lpszString, "r" ); But i get error as fopen' : cannot convert parameter 1 from 'unsigned short *' to 'const char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast i need ur help to sole this issue.
-
Converting Integer to POSITION?I hv Integer Value which i need to convert as POSITION to assign starting POSITION for the collection class. CTypedPtrMap m_Contacts; POSITION pos; CString strKey; CContact* pContact; // Collection class which reads information from local file int iIndex = m_screenName.GetCurSel(); // gets cursor position from combo Now i need to assign the cursor position as POSITION for CTypedPtrMap. m_Contacts.GetNextAssoc(pos, strKey, pContact); Please inform me how to solve this?
-
how to get currently selected Bitmap's ID or reource no?I added bitmaps in array and display in screen. By clicking mouse event, i increment the image and load next bitmap.Now i need to know the currently selected bitmap for further validation and processing. It will be easy if it returns Resource NO or ID so that i can verify and process. Getobject and GetCurrentBitmap does not solve this issue.How to do it?:confused: BSugu