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

LCI

@LCI
About
Posts
269
Topics
129
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Reading Unicode from a text file
    L LCI

    Oh i see... So if i just do this: "You have to define _UNICODE and UNICODE and you have to set the Entry-Point symbol in the Linker output options to wWinMainCRTStartup" Is that equivalent to building as unicode or does that serve a totally different purpose relating to the output of the application?

    C / C++ / MFC csharp c++

  • Reading Unicode from a text file
    L LCI

    When you say that the app has to be Unicode enabled, do you mean building it as Unicode as opposed to release?

    C / C++ / MFC csharp c++

  • Reading Unicode from a text file
    L LCI

    I am trying to read the Unicode output from an application. the application writes strings out to a .txt file using : L"Date, Time, 150" I am trying to read the value of the number, but since it is unicode, this is not a straight ReadFile operation. Is there any way in MFC to do this nice and clean. I know C# has some built in functionality to make a conversion to interpret the text. Thanks,

    C / C++ / MFC csharp c++

  • I/O operation sytem error
    L LCI

    I do not log the number that returns, but the related message is : "The I/O operation has been aborted either because of a thread exit or an application request." BTW, i cannot reproduce. I just know when it happens.

    C / C++ / MFC help question

  • I/O operation sytem error
    L LCI

    I am in a loop, reading from an RS232 port. There are times when i receive an exception with a system message that says: "The I/O operation has been aborted because of either a thread exit or an application request" // read a byte from port while (!m_bExit) { // reset flag variables dwBytesRead = 0; // read bRC = ReadFile(m_hCommPort, pDataBuff, 20, &dwBytesRead, NULL); dwError = GetLastError(); if (!bRC) { if (ERROR_HANDLE_EOF != dwError || ERROR_TIMEOUT != dwError) { LPVOID SysMsg; // reterieve system message FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&SysMsg, 0, NULL ); // show system message ZeroMemory( m_szBuffer, sizeof(m_szBuffer) ); wsprintf(m_szBuffer, TEXT("ReadRS232Data() over %s: ReadFile(), %s"), m_Port, (LPCTSTR)SysMsg); LocalFree(SysMsg); return 0; } } Has anyone ever found a solution to this or know what would cause this error? Cause once this happens you cannot read from the port until it is out of this conditions which seems to just happen on its own. Thanks in advance for any help or direction.

    C / C++ / MFC help question

  • Reading large quantity of data from a file
    L LCI

    I actually do encode to base64. It does not even get that far as it is stuck reading all the data from the file. The reason i need to do it this way is because another application creates this data(video) and dumps it to a folder. My application has to read it in, and put in an XML tag along with other data pertaining to it. Any ideas to make this process better from a bandwidth perspective?

    C# xml performance help tutorial

  • Display Jpeg and othe rtext on a windows forms app
    L LCI

    Any documentation or quick examples on how i would use this control? I am sort of new to this. Thanks, cw

    C# winforms tutorial question

  • Reading large quantity of data from a file
    L LCI

    I have to read a large quantity of bianry data from a file and then store this data in an XML tag. There is approximately 8 MB of data. This can be slow just to read the 8MB into memory using StreamReader. I tried reading sayy 500k at a time. But i still have the issue of storing 8MB into memory. If i would have just read 500k and then write 500k, i would be ok. But i am using XMLTextWriter that does not allow me to write tag data piece by piece. I have to have all the data and then write it to tag. Any suggestions on how to handle this effectively will be appreciated. Thanks, cw

    C# xml performance help tutorial

  • Display Jpeg and othe rtext on a windows forms app
    L LCI

    I have an app that uses filewatcher to monitor a directory. When a file gets in the directory it reads it, pulss out the jpeg and other data perfectly. Now i would like to display this data on the screen. I have created a picture control and some text controls to dsiplay this data. Anyone have some guidance or good source examples on how to do this?

    C# winforms tutorial question

  • how to show a jpeg on a picture control in C#
    L LCI

    Can i get some guidance? I would like to display jpeg data on a picture control or control of some sort that is on a form. What exactly would i do here to accomplish this?

    C# csharp tutorial question

  • Cannot seem to be able to write a byte[] to a file
    L LCI

    thanks, i'll try that. If i would like to put 4 images on the form, i would have to write them to a control write?

    C#

  • Cannot seem to be able to write a byte[] to a file
    L LCI

    Thanks, this worked great. Do you know how i would write this jpeg data in the form of byte[] to a form instead of to a file? So in other words i would like to display jpg on the form. Would i need a picture control?

    C#

  • Cannot seem to be able to write a byte[] to a file
    L LCI

    I am using StreamWriter to write out some jpeg data in byte[] to a file. The result of my file is always "System.Byte[]" byte[] jpegData = new byte[img.Length]; jpegData = Convert.FromBase64String(img); using (StreamWriter sr1 = new StreamWriter("C:\\123.jpg")) { sr1.Write(Convert.ToString(jpegData)); sr1.Flush(); sr1.Close(); }

    C#

  • Passing by reference vs. Value
    L LCI

    So if i wanted to do it by reference then i would add an & to the function definition like : TestMyStuff(LPTSTR& szCode) { } I have never worked with LPTSTR's so i am just a tad confued with how to pass by reference using LPTSTR

    C / C++ / MFC question visual-studio

  • Passing by reference vs. Value
    L LCI

    Is this correct? What i am attempting to ensure is that the arrErrCode[i]var is being passed by reference to the TestMyStuff method. The question is by using a LPTSTR vs. an &, i should get the same result correct? Main { For (int 1= 0; i<2; i++) { arrErrCode[i] = new TCHAR[16]; ZeroMemory(arrErrCode[i], 16 * sizeof(TCHAR)) if (TestmyStuff(arrErrCode[i])) //do something here with arrErrCode[i] } } BOOL TestMystuff(LPTSTR szCode) { StrCpy(szCode, TEXT("000")); return TRUE; }

    C / C++ / MFC question visual-studio

  • static_cast and reinterpret_cast
    L LCI

    I will check. In my code i use it to make another function call in class B and all is well. However, the call in questiuon here is actually used within an "if" block. Scope should be ok though. I will check on it.

    C / C++ / MFC question discussion

  • static_cast and reinterpret_cast
    L LCI

    I sort of see what you are saying. Can you expand a little? Thanks,

    C / C++ / MFC question discussion

  • static_cast and reinterpret_cast
    L LCI

    Here is what i have: The app freezes in Class B which is a dll. I know that there is something wrong with the parameter that the thread is receiving in that dll, but i cannot figure it out. ClassA { CWinThread* pThreadA[3] = {NULL}; CClassA::BeginAllThreads() { CClassC* pApp = reinterpret_cast(AfxGetApp()); if (NULL == pThreadA[i]) { pThreadA[i] = AfxBeginThread(ThreadGetOne, (LPVOID)pApp->m_arrPtr[i], THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED, NULL); pThreadA[i]->m_AutoDelete = FALSE; pThreadA[i]->ResumeThread(); pApp->arrPtr[i]->StartThread(); } } void ThreadGetOne(LPVOID pVoid) { CClassB* pPointer = (CClassB*)pVoid while (TRUE) { pPointer->Readport(); } } } //This is a .dll ClassB { void CClassB::StartThread() { _beginthread(MYBThread, 0, LPVOID(this)); } void MYBThread(void* pVoid) { CClassB* pPointer = static_cast(pVoid); while (pPointer->IsOn()) //HERE IS WHERE THE APP Freezes { //do something } _endthread(); } } ClassC { CClassB* m_arrPtr[3]; }

    C / C++ / MFC question discussion

  • static_cast and reinterpret_cast
    L LCI

    Any member this seems to have an issue with .

    C / C++ / MFC question discussion

  • static_cast and reinterpret_cast
    L LCI

    In a dll, i start a thread using _beginthread like: _beginthread(Mythread,0,LPVOID(this)); void MyThread(LPVOID pVoid) { CMyClass* pClass = static_cast<CMyClass*>(pVoid); pClass->SetValue(1); } Everything works nicely until i try to access one of the member vars from CMyClass. The app begins to lock up on me. I may be missing something fundamental here. Anyone have any thoughts?

    C / C++ / MFC question discussion
  • Login

  • Don't have an account? Register

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