Click here to Skip to main content
Page 1 of 15
Page Size: 10 · 25 · 50


Author filtered by: Jochen Arndt [x]
Forum Message 14 May 2013  
All you are sharing here is a link to an online file type detector. I understand that this link was helpful your you. But I don't think that it is enough for a tip. To get the type of a file (even
Answer 14 May 2013   license: CPOL
I assume your receiving thread is a worker thread and has therefore no message loop. The common solution is to use events to signal such threads that some special action should be performed. Inside the while loop use WaitForMultipleObjects() to check for events from I/O operations and those...
Answer 13 May 2013   license: CPOL
The 'd' as last character of the file name indicates that it is a debug DLL. You are probably trying to install a debug version of your application. You should provide a release version with your setup.
Forum Message 13 May 2013  
I don't know why. You may check if tabs are shown when using in resource based menus. If not, the problem is application based. You may also check if '\a' is working (same as '\t' but text is left
Forum Message 13 May 2013  
Call GetLastError() upon failure to know more about the reason.
Forum Message 13 May 2013  
The code looks fine. Because only one of the strings from your array returns wrong data, this element may be corrupted somewhere else. Note also that you must call ReleaseBuffer() for
Forum Message 12 May 2013  
With menu items, the tab character is used to right align text in a new column (commonly to print accelerator short cuts). See also the
Forum Message 9 May 2013  
I don't have an Arduino board, so I can't check this. But the board seems to use a FTDI chip as serial to USB converter and will probably therefore use the FTDI virtual COM port driver. The demo progr
Re: 64 bit MFC apps by Jochen Arndt
Forum Message 8 May 2013  
This looks really messy. You are using main_app before assingning AfxGetApp(). Is it assigned somewhere else? If not, you may get the exception here. Also (inspired my
Answer 8 May 2013   license: CPOL
The error message indicates stack problems around threadno. And it is really helpful here when looking at the occurences for that variable:char threadno[2];itoa(threadNumber,threadno,10);strcat(threadno,".txt");Did you see the problem? The string can hold only one character plus NULL...
Answer 7 May 2013   license: CPOL
It would be better when you have posted the code to read the file content. Then we could have shown you where the problems are.However, reading the contents of a text file into a buffer is a basic task:// file name; fixed name here as examplechar *FileName =...
C
Needs work. by Jochen Arndt
Forum Message 7 May 2013  
The article needs a lot of work before it might by accepted: - Images should be hosted here and not off-site, - Code should be formatted using the CodeProject style To be an article, there must
Answer 7 May 2013   license: CPOL
You are using SetFilePointerEx() which expects a LARGE_INTEGER (64 bit) as distance parameter but pushes only a 32 bit word on the stack.Because you are reading from the begin of the file, using SetFilePointer() might be sufficient.
Answer 7 May 2013   license: CPOL
Did you report errors and terminate the thread when a function call fails?There is at least one wrong call that should result in an error return (best case) or undefined behaviour (worst case):WSAWaitForMultipleEvents(2, &hEvent, FALSE, WSA_INFINITE, FALSE);You are passing 2 for the...
Answer 6 May 2013   license: CPOL
The code is compiling because you are casting incompatible types. So the compiler can not check the types. Remove the unnecessary typedef and the casting, and pass the correct parameter (the element of the function array, not the address to it):LPTHREAD_START_ROUTINE function[3] =...
How to use CDaoDatabase? by Jochen Arndt
Answer 6 May 2013   license: CPOL
There are many ways to use the CDao* classes. If you only want to read some fields from one or more tables, you can omit the creation of special derived classes to access them:CDaoDatabase db;try{ // Open access file: non-exclusive, read only // When db is password protected,...
Answer 5 May 2013   license: CPOL
The error indicates the missing return type of the main() function. Because main() must return an int, use:int main(){ // ... return 0;}
C++
Forum Message 5 May 2013  
Use GetDiskFreeSpace()[
Answer 5 May 2013   license: CPOL
The styles for static controls are divided into two sections: The lower bits up to 0x1F (SS_TYPEMASK) are an enumeration defining the type of the control while the upper bits define styles. Have a look at the SS_* definitions in WinUser.h. If you combine SS_ICON (0x03) and SS_WHITERECT (0x06)...
Answer 2 May 2013   license: CPOL
You are looking for something like the file command on Linux with it's magic data file.If you only want to identify a few image file types, just read some bytes from the begin of the file and check them for image file specific sequences:const char *lpszType = NULL;char pBuffer[16] =...
Answer 2 May 2013   license: CPOL
See GetErrorInfo[^] in the MSDN:Quote:Obtains the error information pointer set by the previous call to SetErrorInfo in the current logical thread.If you got the return valueQuote:S_FALSE There was no error object to return. , no error info has been set by a COM function which is obvious...
Re: MESSAGE MAP error by Jochen Arndt
Forum Message 2 May 2013  
Thank you for your feedback. Such mistakes happen (even to me after years of programming). When forgetting the semicolon at the end of a header file, the error is thrown at the first semicolon in
Answer 2 May 2013   license: CPOL
You are passing the thread parameters by value by casting int to LPVOID. That is the correct way because the variables are local.But in your thread function, you are accessing them as pointers. You must do it there in a similar way by just casting the LPVOID to int:int iParam =...
Re: MESSAGE MAP error by Jochen Arndt
Forum Message 2 May 2013  
I can't see anything seriously wrong in the posted code. So the error may be also somewhere else (probably in a line before number 33 in mydialog.cpp). A possible error source is forgetting the traili
Answer 1 May 2013   license: CPOL
You may create an array holding the addresses of your thread procedures:LPTHREAD_START_ROUTINE pThreadProcs[] = { ThreadProc1, ThreadProc2 /*, ...*/};for (int i = 0; i
Answer 1 May 2013   license: CPOL
You tagged MFC. So you can use the COleDateTime class which uses DATE internally and provides the Format()[^] function to convert it to a string:COleDateTime dt(JobStartTime);CString strJobStartTime = dt.Format(_T("%d/%m/%Y %H.%M.%S"));The above formats the string like the example from...
Not an article by Jochen Arndt
Forum Message 29 Apr 2013  
I'm sorry, but this is not enough for an article. It is just a code dump without without explanations. You may repost this as tip. But I suggest to add some more explanations and think about the co
Answer 28 Apr 2013   license: CPOL
Although off-topic, this link may help you: http://social.technet.microsoft.com/Forums/en-US/winserverGP/thread/2aa2e0ff-85aa-4ac0-ad62-78af95d93849/[^].The tip you found in the net misses a warning that should be placed in big letters on the top:WARNING: You may lock yourself when not...
Answer 28 Apr 2013   license: CPOL
From within the WM_SETTINGCHANGE handler of your main window you can send this message (or a user defined one) to all descendant windows using SendMessageToDescendants[^].
MFC
how to use Rect Class? by Jochen Arndt
Answer 27 Apr 2013   license: CPOL
You probably wanted to use the CRect class.Note that all MFC class names begin with an uppercase 'C' letter.
Re: Spam would-be article by Jochen Arndt
Forum Message 27 Apr 2013  
I just kicked the articles with the 5th report before reading this. But the accounts need one more report.
Answer 26 Apr 2013   license: CPOL
When reading data from the file, you are counting the lines using the variable i. Because your buffers have a size of 50, you should also check this here:while( i
Plagiarized by Jochen Arndt
Forum Message 26 Apr 2013  
A direct copy from http://techighost.com/differences-between-stored-procedures-and-user-defined-functi
Forum Message 25 Apr 2013  
Searching the web for 'sqlite tutorial' should help. http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html[
What has been changed? by Jochen Arndt
Forum Message 25 Apr 2013  
All I can see are the new " /> characters behind the smileys which should be removed.
Forum Message 25 Apr 2013  
You may create two tables where one contains a reference (foreign key) to the other: TABLE example2 INT id unique ID, usually auto increment INT value TABLE exampl
Answer 25 Apr 2013   license: CPOL
You can write your own:#define MY_ASSERT(f) (void) ((f) || !MyAssertFailedLine(__FILE__, __LINE__))BOOL MyAssertFailedLine(LPCSTR lpszFile, int nLine){ char lpszMsg[512]; _snprintf(lpszMsg, 512, "MyAssert failed in %s on line %d.\nExit?", lpszFile, nLine); ...
C++
Re: iso_8583 message by Jochen Arndt
Forum Message 24 Apr 2013  
He kindly asked you to edit your existing post (there is a button to do so) and format the source code so that it is readable. To do so, select the code section and click the 'code' button above the e
Forum Message 23 Apr 2013  
The error message indicates that the database has been opened by another application with exclusive access or the user hasn't sufficient privileges to access the database file. When using the
Answer 22 Apr 2013   license: CPOL
Edit controls does not provide functions to manipulate single characters. You have two options:1. Get the complete text, modify it, and store it backUse GetWindowText() to retrieve the text, modify it, and put it back using SetWindowText(). When using a CString, a single character can be...
Answer 17 Apr 2013   license: CPOL
See the MSDN article How to write an application that supports fast user switching in Windows XP[^]. The section Detect an Existing Application Instance describes how to add code to check if another instance is already running even when started by another user.[EDIT]An example with good...
Answer 15 Apr 2013   license: CPOL
As far as I know, the memory of solid brushes is not always freed when calling DeleteObject() but reserved and reused with following CreateSolidBrush() calls by simply replacing the color value. This can be verified by calling GetGuiResources() before and after creation and deletion. In some...
Answer 13 Apr 2013   license: CPOL
There is no difference between dialog and frame based applications regarding context menus of controls. To add a context menu to a list control, create the menu using the resource editor and add the ON_WM_CONTEXTMENU() / OnContextMenu() handler to your list control class:void...
MFC
Answer 12 Apr 2013   license: CPOL
I did not see the source for the heap error but you also asked for the right or simpler way. At first you should know that the HTML clipboard format must contain UTF-8 encoded text. So the input text must be converted to UTF-8 and prefixed with the HTML format header. A snippet from one of my...
Forum Message 9 Apr 2013  
The only method I know is creating a child process with redirected input and output. An example can be found in the MSDN:
Forum Message 9 Apr 2013  
From the WM_LBUTTONDBLCLICK entry in the MSDN: Quote:Posted when the user double-clicks the left mouse button while the cursor is in the cli
Answer 8 Apr 2013   license: CPOL
There is no Windows API function to get the open/close state for the tray of optical drives. You can use DeviceIoCtl() to check if such a drive has a media inserted indicating that the tray is actually closed.To get notifications when the tray is closed or opened with inserted media, add a...
Forum Message 7 Apr 2013  
Use the TCHAR version of fopen. Then the code can be used with Unicode and MBCS builds: CString fileName = _T("c:\\1.bin"); _tfopen(fileName, _T("wb"));
Forum Message 5 Apr 2013  
You are creating a user-interface thread. With socket operations worker threads are usual. Also, why did you retry to create the thread if the first call fails? This makes no sense. If the thr
Re: OnFileOpen crashing by Jochen Arndt
Forum Message 5 Apr 2013  
So the problematic code is at least isolated even when it looks OK. As next step you may assign the fixed file name to strFile ignoring the selection from the dialog.

Page 1 of 15
1 2 3 4 5 6 7 8 9 10


Advertise | Privacy | Mobile
Web03 | 2.6.130513.1 | Last Updated 14 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid