Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
L

ledallam

@ledallam
About
Posts
96
Topics
65
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Problem loading a dll - Crashes with R6034 Error
    L ledallam

    Hi, Thanks for your inputs. The dll is built with manifest file and same is the case with test application used to call LoadLibrary on the Dll. The dll when built in VS 2008, gives an error message “failed to Register the Active X Control”. The dependency walker shows all dlls are being correctly referred. I still get the R6034 error message with assertion on the LoadLibrary call. Is there any way to step into the LoadLibrary function and figure out which C runtime library is the LoadLibrary unable to load? Thanks

    IT & Infrastructure help visual-studio debugging

  • Problem loading a dll - Crashes with R6034 Error
    L ledallam

    Hi, I have a dll that was built in VS 2008. I am trying to load it using LoadLibrary() function call. I am getting a Runtime error R6034. I am running the application in debug mode with break point set on LoadLibrary function call, but does'nt break into the function of LoadLibrary. Can anyone please help me to debug this problem. Any suggestions or any hints are highly appreciated. Thanks in advance.

    IT & Infrastructure help visual-studio debugging

  • Socket Connection problem in Windows XP System from VC++
    L ledallam

    Setttings are the same in both....

    C / C++ / MFC help c++ json question

  • Socket Connection problem in Windows XP System from VC++
    L ledallam

    I am using the following function to find out whether I can connect to a particular IP address(for ex:3.205.202.6 etc...) in VC++. This function returns TRUE on Windows 2000 if the given IP address is communicating one. But on Windows XP system it always returns FALSE (However I can still say ping to this IP :- 3.205.202.6 from DOS command prompt. It replies correctly). Can anyone please help me to root cause this issue in Windows XP system. Is this socket API not valid on Win XP system? On Win2000, it always gives me the correct status. BOOL IsOnline(const CString &strIPAddr) { SOCKET tmpSocket; struct sockaddr_in SClient; u_long argp; fd_set stReadFDS; fd_set stWriteFDS; fd_set stExceptFDS; struct timeval stTimeOut; int nSelectReturn; DWORD nTicks; DWORD nTickStart; //create a socket tmpSocket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) ; if (tmpSocket == INVALID_SOCKET) { return FALSE; } // make the socket non blocking argp = 1L; // non zero enables nonblocking mode if (ioctlsocket(tmpSocket, FIONBIO, (u_long FAR *) &argp) == SOCKET_ERROR) { closesocket(tmpSocket); return FALSE; } // connect to the given IP address SClient.sin_family = AF_INET; SClient.sin_port = htons(502); SClient.sin_addr.s_addr = inet_addr(strIPAddr); int nLastErr; if (connect(tmpSocket, (sockaddr *) &SClient, sizeof(sockaddr_in)) == SOCKET_ERROR) { nLastErr = WSAGetLastError(); if (nLastErr != WSAEWOULDBLOCK) { closesocket(tmpSocket); return FALSE; } nTicks = 500; nTickStart = GetTickCount(); nSelectReturn = SOCKET_ERROR; int ic = 0; while (nSelectReturn <= 0 && (GetTickCount() - nTickStart) < nTicks) { // clear all sockets from FDS structure, then put our socket into the socket descripter FD_ZERO(&stReadFDS); FD_ZERO(&stWriteFDS); FD_ZERO(&stExceptFDS); FD_SET(tmpSocket, &stReadFDS); FD_SET(tmpSocket, &stWriteFDS); FD_SET(tmpSocket, &stExceptFDS); // set a timeout of 1 second stTimeOut.tv_sec = 1; stTimeOut.tv_usec = 0; nSelectReturn = select(-1, &stReadFDS, &stWriteFDS, &stExceptFDS, &stTimeOut); if (nSelectReturn == SOCKET_ERROR) { nLastErr = WSAGetLastError(); if (nLastErr != WSAEINPROGRESS) { closesocket(tmpSocket); return FALSE; } } } if (nSelectReturn <= 0 || stWriteFDS.fd_count == 0) { closesocket(tmpSocket); return FALSE; } } close

    C / C++ / MFC help c++ json question

  • Tooltip text in CFormView
    L ledallam

    Hi I am trying to display tool tip text on icons placed on CFormView. I am using these functions: ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipText) ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipText) BOOL CDashboardView :: OnToolTipText (UINT id, NMHDR *pNMHDR, LRESULT *pResult) { BOOL result = TRUE; /* Operation result */ CString strTipText; /* tool tip text */ UINT nID = -1; /* Identifier */ TOOLTIPTEXTA* pTTTA = NULL; TOOLTIPTEXTW* pTTTW = NULL; CPoint point; /* current cursor point */ pTTTA = (TOOLTIPTEXTA*)pNMHDR; pTTTW = (TOOLTIPTEXTW*)pNMHDR; nID = pNMHDR->idFrom; if (nID != 0 ) { // Identify button rect, copy text for (long ii = 0; ii < m_arrLineupBtnRect.GetSize(); ii++) { GetCursorPos (&point); ScreenToClient (&point); if (m_arrLineupBtnRect[ii].PtInRect(point)) { strTipText = m_sButtLineups[ii].m_strToolTip; } } // Copy tool tip text if (pNMHDR->code == TTN_NEEDTEXTA) { lstrcpyn(pTTTA->szText, strTipText, strTipText.GetLength()); } else { _mbstowcsz(pTTTW->szText, strTipText,strTipText.GetLength()); } *pResult = 0; } return result; } My problem is that the tool tip text has about 280characters. The program crashes at the line lstrcpyn(pTTTA->szText, strTipText, strTipText.GetLength()); It works fine for about 80 characters in tool tip text. Is there any limit for the tool tip text. Thanks Madhavi

    C / C++ / MFC help

  • How to close a file opened using ShellExecute
    L ledallam

    Hi, I am woking with a dialog based application.On click of a button I opened a text file using ShellExecute(NULL, "C:\\Text.txt", szPath, NULL, NULL, SW_MAXIMIZE ); On clicking another button I should be able to close this file. Can anyone please help with some function that automatically closes a file when passed the file path to it. Thanks

    C / C++ / MFC help tutorial

  • Optimization on FileReading in VC++
    L ledallam

    Hi, I am working with File reading in VC++. I am reading a log file which has around 1 lakh records. I have to read each record and filter them based on some options and display them on the UI. The problem that I am facing is that it takes enormous amount of time to read so many records. I am using CStdIOFile for reading. Can any one please help me with some optimization techniques that will speed up my reading process. Thanks Madhavi.

    C / C++ / MFC performance help c++ design algorithms

  • Excel Automation in vc++
    L ledallam

    Hi I am working with excel automation. I need to write an excel file from VC++. The format of the excel file should be Events Table Date&Time,Source,Cause,Description,Fault - 3rd row Mar 13 2006 12:25:05.000078,HMI,H-0001,Startup,N Mar 13 2006 12:25:05.000187,HMI,H-0005,Caution,Y ect... Footer I used excel automation as shown below. CoInitialize(NULL); try { Excel::_ApplicationPtr excel; // Initialize Excel and make sure it's initialized HRESULT hr = excel.CreateInstance(L"Excel.Application"); Excel::_WorkbookPtr workbook = excel->Workbooks->Add(static_cast (Excel::xlWorksheet)); Excel::_WorksheetPtr worksheet = excel->ActiveSheet; worksheet->Range["A1"]->Value = "Header1"; worksheet->Range["A2"]->Value = "Header2"; worksheet->SaveAs("c:\\test1.xls"); // Save it workbook->Close(); // Close the workbook excel->Quit(); // Quit excel } catch(_com_error &ce) { AfxMessageBox("Error"); } CoUninitialize(); Now the problem is, since I don't have the number of cells varry , I want to run a ForLoop where I can input the values in the Range function as shown here.....worksheet->Range["A1"]->Value = "Header1"; I am facing some problems when I try to give the values here as char* str = new char(3); str = "B3"; worksheet->Range[str]->Value = "Header1"; Can anyone please help me with some sample code for doing this? Thanks Madhavi..

    C / C++ / MFC help c++ testing tools question

  • Writing data to excel file through code in vc++
    L ledallam

    I am using the CSpreadSheet class from codeproject website: http://www.codeproject.com/database/cspreadsheet.asp but this class is not allowing to write data in the above format..

    C / C++ / MFC c++ help

  • Writing different colums of data into excel file through code in vc++
    L ledallam

    Hi, I am working with vc++. I need to write an excel file with the below format in VC++. Events Table - 1st row Description of table - 2nd row Date&Time,Source,Cause,Description,Fault - 3rd row Mar 13 2006 12:25:05.000078,HMI,H-0001,Startup,N Mar 13 2006 12:25:05.000187,HMI,H-0005,Caution,Y Basically the first row in the excel file must have the table heading, second row must have the table description and the third row will have the column names and fourth row onwards the actual data. I am able to create an excel file if all the rows have the same number of columns. But I am unable to create an excel file with different numberof columns in the rows as shown above. I am using the CSpreadSheet class from codeproject website: http://www.codeproject.com/database/cspreadsheet.asp but this class is not allowing to write data in the above format.. Can anyone please help me to do this. Thanks Madhavi.

    C / C++ / MFC c++ database com help

  • Writing data to excel file through code in vc++
    L ledallam

    Hi, I am working with vc++. I need to write an excel file with the below format in VC++. Events Table - 1st row Description of table - 2nd row Date&Time,Source,Cause,Description,Fault - 3rd row Mar 13 2006 12:25:05.000078,HMI,H-0001,Startup,N Mar 13 2006 12:25:05.000187,HMI,H-0005,Caution,Y Basically the first row in the excel file must have the table heading, second row must have the table description and the third row will have the column names and fourth row onwards the actual data. I am able to create an excel file if all the rows have the same number of columns. But I am unable to create an excel file with different numberof columns in the rows as shown above. Can anyone please help me to do this. Thanks Madhavi.

    C / C++ / MFC c++ help

  • CSingleLock problem
    L ledallam

    Hi, I am working with threads. I have a thread safe class as shown below. class CUxx_MS_ListWordToPtr { // VARIABLE DECLARATION SECTION public: private: //##ModelId=38BB19E501C9 CUxx_MS_CriticalSection m_Lockable; //##ModelId=38BB19E501B5 CMapWordToPtr* m_List; CSemaphore threadlock; // FUNCTION DECLARATION SECTION public: // Construction //##ModelId=38BB19E50291 CUxx_MS_ListWordToPtr(int nBlockSize = 10) { m_List = new CMapWordToPtr(nBlockSize); } // lock functions //##ModelId=38BB19E50290 void Lock() { m_Lockable.Lock(); } //##ModelId=38BB19E50287 void Unlock() { m_Lockable.Unlock(); } // Attributes // number of elements //##ModelId=38BB19E50286 int GetCount() const { //CUxx_MS_Lock localLock((class CUxx_MS_LockableObject *) &m_Lockable); // CUxx_MS_CriticalSection cs; CSingleLock singleLock( (CSyncObject*)&threadlock); singleLock.Lock(); int count = m_List->GetCount();; singleLock.Unlock(); return count; } //##ModelId=38BB19E5027D int GetCountNoLock() const { return m_List->GetCount(); } //##ModelId=38BB19E5027C BOOL IsEmpty() const { //CUxx_MS_Lock localLock((class CUxx_MS_LockableObject *) &m_Lockable); CSingleLock singleLock( (CSyncObject*)&threadlock); singleLock.Lock(); BOOL flag = m_List->IsEmpty(); singleLock.Unlock(); return flag; } //##ModelId=38BB19E50274 BOOL IsEmptyNoLock() const { return m_List->IsEmpty(); } ........ } The way I use this class is CTypedPtrMap ListOutput; when I call methods like, CString* pCStr; CMemMapMgr* pCommunicationObject; ListOutput.Lookup(*pCStr, pCommObject), sometimes it shows an error message-> The instruction at ".." referenced memory at " ", The memory could not be read and when I debug the code, it shows the root as BOOL CSingleLock::Lock(DWORD dwTimeOut /* = INFINITE */) { ASSERT(m_pObject != NULL || m_hObject != NULL); ASSERT(!m_bAcquired);

    C / C++ / MFC help debugging performance

  • CSingleLock doubt
    L ledallam

    Hi, I am working on Threading and am using CSingleLock to control access to shared resource. I have a doubt..must the CCritical section be member of the class or can it be local to the function? 1) void foo() { CCriticalSection CritSection; CSingleLock singleLock(&CritSection); } void foo1() { CCriticalSection CritSection; CSingleLock singleLock(&CritSection); } 2) CCriticalSection m_CritSection; void foo() { CSingleLock singleLock(&m_CritSection); }void foo1() { CSingleLock singleLock(&m_CritSection); } Are both the baove approaches correct? Please give me your inputs on this? Thanks

    C / C++ / MFC question learning

  • Troubleshooting R6025 Runtime error message
    L ledallam

    Hi, Thanks for your reply.. This crash occurs only in release mode. It does not occur If I set the bebug information(i.e Link->GenerateDebugInfo settings ) in release mode. Moreover this does not reproduce in release mode always..It comes up some times only..i.e I don't have the steps for repeating this error. Hence I don't think it is problem with virtual function call. If it was a problem with virtual function call, I should be able to reproduce this error always in both debug and release builds ..right? Is there any other reason for this error message? Do my Link options of Project settings have any impact on this error? My link options are: CTS32D.LIB RTS32D.LIB TAPI32.LIB VERSION.LIB WINMM.LIB VFW32.LIB.. Please let me know if you have further inputs on this as I am not getting any clue for resolving this issue.. Is there any tool that can catch and take us to the code that is creating these runtime errors.. Thanks.. Madhavi..

    C / C++ / MFC debugging help tutorial c++ question

  • Troubleshooting R6025 Runtime error message
    L ledallam

    Hi , Thanks for your help..I understood the concept here.. The problem is that there are hundreds of virtual functions in the project that are not written by me and moreover I get this exception only in release mode. If I run the application in release with debug information, I am still not able to reproduce this exception. So is there any way to find out from where this exception is coming while running in release mode? Thanks Madhavi.

    C / C++ / MFC debugging help tutorial c++ question

  • Troubleshooting R6025 Runtime error message
    L ledallam

    Hi Stephen Hewitt, Thanks for your help. I understood the concept here.. I went through the aricle available at:

    C / C++ / MFC debugging help tutorial c++ question

  • Troubleshooting R6025 Runtime error message
    L ledallam

    Hi, I am woking on VC++ project. When I run the project in Release mode, I am getting R6025 Runtime error message. The project has hundreds of virtual functions not written by me and I have no clue as to find out from where this message box is coming? If I run in debug mode, I am not getting this error message box. If I try to debug in release mode, I am still not getting this error message. Can anyone please guide me as to how to trace out the cause for thsi problem? Thanks Madhavi

    C / C++ / MFC debugging help tutorial c++ question

  • Problem updating the status bar
    L ledallam

    Yes I am using custom CStatusBar Class.

    C / C++ / MFC help

  • Problem updating the status bar
    L ledallam

    The status bar is a member of mainfrme class itself and the function that updated the status bar is also in the main frame, so I use it directly. I'll call the function that updates the status bar from my form view calss

    C / C++ / MFC help

  • Problem updating the status bar
    L ledallam

    Hi, I have a form view class derived from CFormView. In this class I have a thread which does some processing for every 30 seconds and generates a status message which is of type CString. I need to show this message in the Status Bar. From within the form view class I am calling a method names UpdateOnlineStatusMessage in the Frame Window class which updates the status bar. void UpdateOnlineStatusMessage(CString strMsg) { PANEINFOEX pex; pex.iIndex = 0; pex.strText = strMsg; pex.iFlags = SBP_ID | SBP_TEXT; m_wndStatusBar.SetPaneInfoEx(&pex); } Here m_wndStatusBar member that represents the status bar in the FrameWindow calss. I am getting an assertion while trying to access m_wndStatusBar member. Can anyone please help me to solve this. Thanks Madhavi.

    C / C++ / MFC help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups