9,868,710 members (30,233 online)
Visit CodeProject.TV
Discuss CodeProject.TV
Sign in
Email
Password
Forgot your password?
Sign in using
home
articles
Chapters and Sections
>
Search
Latest Articles
Latest Tips/Tricks
Top Articles
Beginner Articles
Technical Blogs
Posting/Update Guidelines
Article Help Forum
Article Competition
Submit an article or tip
Post your Blog
quick answers
Ask a Question
View Unanswered Questions
View All Questions...
C# questions
ASP.NET questions
VB.NET questions
C#4.0 questions
C++ questions
discussions
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work & Training Issues
Design and Architecture
ASP.NET
JavaScript
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
Adobe Technologies
C#
Free Tools
Objective-C
Ruby On Rails
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
.NET Framework
Mobile
VS 11 & .NET 4.5
Sharepoint
Silverlight / WPF
Visual Basic
Web Development
Site Bugs / Suggestions
features
Component & Service Catalog
Competitions
News
The Insider Newsletter
Newsletter archive
Surveys
Product Showcase
Research Library
CodeProject Stuff
community
The Insider News
The Lounge
The Weird & The Wonderful
The Soapbox
Press Releases
Who's Who
Most Valuable Professionals
Company Listings
Non-English Language
>
General Indian Topics
General Chinese Topics
help
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
Site Map
Advertise with us
Employment Opportunities
About Us
The default search term operator is
AND
.
You can use brackets,
AND
,
OR
, and
NOT
to improve your search. For example:
C# AND NOT(VB or SQL)
A query of a single
*
will return everything, filtered by any filters.
Filter examples:
Search by Author
author:"author name"
Filter by tag
tag:C#
or
tag:(C++ or Java)
Wildcard search
use "?" or "*" eg.
gr?d
or
gr*
728 Results
Search
Everything
Articles
Technical Blogs
Tips & Tricks
Questions
Answers
Forum Messages
News Items
Catalog Items
Videos
Training Courses
Just My Stuff
My Bookmarks
Sort by
Relevance
Rating Asc
Rating Desc
Title Asc
Title Desc
Author Asc
Author Desc
Date Created Asc
Date Created Desc
Date Modified Asc
Date Modified Desc
Price Asc
Price Desc
Duration Asc
Duration Desc
Match
All Fields
Title
Description
Author(s)
Tags
Any Date
Last 12 hours
Last 24 hours
Last week
Last 2 weeks
Last month
Last 3 months
Last 6 months
Last year
January
February
March
April
May
June
July
August
September
October
November
December
Rating Range
All - Including Unrated
1.0 - 5.0
2.0 - 5.0
3.0 - 5.0
4.0 - 5.0
4.5 - 5.0
4.8 - 5.0
5.0
Advanced Filters:
Article Topics
All Topics
Desktop Development
Web Development
Mobile Development
Cloud Computing
Enterprise Systems
Database
Multimedia
Languages
Platforms, Frameworks & Libraries
General Programming
Graphics / Design
Development Lifecycle
General Reading
Third Party Products
Mentor Resources
Article License
All Licenses
CPOL
CDDL
Ms-PL
MPL
CPL
Eclipse
MIT
BSD
Apache
CC (ASA 2.5)
Zlib
Public Domain
CC (Attr 3U)
CC (ASA 3U)
LGPL3
GPL3
Forums
All Forums
Feature Forums
General Programming
Web Development
Product Lifecycle
Database & SysAdmin
General Discussions
Non-English Language
Catalog Category
All Categories
Books & Training
Charting & Graphing
Components, Controls, Libraries
Data Manipulation & Mining
Database Tools
Debugging
Documentation & Help
Financial, Math & Scientific
Frameworks & APIs
General Development Tools
GIS & Maps
Graphics & 3D Modeling
Hardware and Robotics
Hosting
IDEs
Imaging
Mobility
Multimedia
Networking
Performance and Profiling
Programming Languages
Project Life-cycle Management (ALM)
Reporting
Search
Security
Setup & Deploy
System Adminstration
Utilities
Virtualization
Web Design/Development
Catalog License
All Licenses
Commercial
Fully Function Evaluation version
Limited Functionality Trial
Limited Time Trial
Shareware
Free For Personal Use
Freeware
Page 1 of 15
Page Size:
10
·
25
·
50
Author filtered by: Jochen Arndt
[x]
Just a link to an online service.
by
Jochen Arndt
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
General Discussions
»
Tip/Trick "Tip On How To Open A File With Unknown Extension"
Handle postthreadmessage() inside a thread which is blocking in while(1) loop
by
Jochen Arndt
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...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
Visual-Studio
Threading
threads
programming
socket
Sockets
Application deployment Error
by
Jochen Arndt
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.
General Programming
»
Uncategorised Quick Answers
»
General
MFC
Visual-Studio
VS2010
Re: How to change the string of a MFC Menu item that contains '\t'
by
Jochen Arndt
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
General Programming
»
C / C++ / Mfc
Re: CBitmap::CreateCompatibleBitmap() fail
by
Jochen Arndt
Forum Message
13 May 2013
Call GetLastError() upon failure to know more about the reason.
General Programming
»
C / C++ / Mfc
Re: char ** initialization and store values
by
Jochen Arndt
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
General Programming
»
C / C++ / Mfc
Re: How to change the string of a MFC Menu item that contains '\t'
by
Jochen Arndt
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
General Programming
»
C / C++ / Mfc
Re: Doesn't work with Virtual COM Ports?
by
Jochen Arndt
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
General Discussions
»
Article "Ready-To-Use Serial Port Enumeration List Box"
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
General Programming
»
C / C++ / Mfc
Run-Time Check Failure # 2 - Stack around variable 'thread no' was corrupted
by
Jochen Arndt
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...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
Visual-Studio
programming
Errors
ErrorHandling
How to input a file for Huffman coding(using C language)
by
Jochen Arndt
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 =...
General Programming
»
Uncategorised Quick Answers
»
General
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
General Discussions
»
Article "Mvvm Pattern Using Wpf In Visual Studio 2012"
error invalid paramter SetPointerEx
by
Jochen Arndt
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.
General Programming
»
Uncategorised Quick Answers
»
General
C++
Win32
ASM
CPU Usage 100% when creating 3 threads and using WSAWaitForMultipleEvents() and WSAEnumNetworkEvents()
by
Jochen Arndt
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...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Threading
threads
Events
programming
udp
multithreading
event
WSA
, +
Unable to create multiple threads using for loop
by
Jochen Arndt
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] =...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
Threading
threads
programming
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,...
General Programming
»
Uncategorised Quick Answers
»
General
C++
MFC
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
by
Jochen Arndt
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;}
General Programming
»
Uncategorised Quick Answers
»
General
C++
Re: How to check the disk space if enough
by
Jochen Arndt
Forum Message
5 May 2013
Use GetDiskFreeSpace()[
General Programming
»
C / C++ / Mfc
How to load icon or bitmap in a static control with style SS_WHITERECT ?
by
Jochen Arndt
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)...
General Programming
»
Uncategorised Quick Answers
»
General
C++
Win32
read the extension of file using binary mode
by
Jochen Arndt
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] =...
General Programming
»
Uncategorised Quick Answers
»
General
C++
VisualStudio2012
MFC/C++
GetErrorInfo returns S_FALSE in WIN32 API
by
Jochen Arndt
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...
General Programming
»
Uncategorised Quick Answers
»
General
C++
Win32
VC++
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
General Programming
»
C / C++ / Mfc
passing one function to different threads
by
Jochen Arndt
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 =...
General Programming
»
Uncategorised Quick Answers
»
General
C++
threads
function
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
General Programming
»
C / C++ / Mfc
How to create multiplethreads each with different ThreadProc() function using CreateThread()?
by
Jochen Arndt
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
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
Threading
threads
programming
multithreading
create
Convert DATE to String in comm c++
by
Jochen Arndt
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...
General Programming
»
Uncategorised Quick Answers
»
General
C++
Win32
MFC
COM+
VC++
Win32.DLL
MFC/C++
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
General Discussions
»
Article "Number To Text (10 Digits)"
Please Help me.... I'm stuck with Group policy Setting in Windows 7....
by
Jochen Arndt
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...
General Programming
»
Uncategorised Quick Answers
»
General
Windows
administrator
How to repositioned dialog based on screen resolution
by
Jochen Arndt
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[^].
General Programming
»
Uncategorised Quick Answers
»
General
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.
General Programming
»
Uncategorised Quick Answers
»
General
MFC
Visual-Studio
VS2010
C++/MFC
rectangle
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.
General Discussions
»
Spam And Abuse Watch
loop to end of file with printf
by
Jochen Arndt
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
General Programming
»
Uncategorised Quick Answers
»
General
C++
C
Plagiarized
by
Jochen Arndt
Forum Message
26 Apr 2013
A direct copy from http://techighost.com/differences-between-stored-procedures-and-user-defined-functi
General Discussions
»
Article "Difference Between Function And Stored Procedure"
Re: Regarding storing structures in database
by
Jochen Arndt
Forum Message
25 Apr 2013
Searching the web for 'sqlite tutorial' should help. http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html[
General Programming
»
C / C++ / Mfc
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.
General Discussions
»
Article "The Findme Project"
Re: Regarding storing structures in database
by
Jochen Arndt
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
General Programming
»
C / C++ / Mfc
How can I get a assert() like debug in release mode?
by
Jochen Arndt
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); ...
General Programming
»
Uncategorised Quick Answers
»
General
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
General Programming
»
C / C++ / Mfc
Re: CDaoDatabase for Opening MS-Access
by
Jochen Arndt
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
General Programming
»
C / C++ / Mfc
How to get the char position in Edit control ?
by
Jochen Arndt
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...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Visual-Studio
CE
Run only one instance of exe at a time in vc++ mfc
by
Jochen Arndt
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...
General Programming
»
Uncategorised Quick Answers
»
General
MFC
VC++
GDI object count does not decrements when i delete the CBrush
by
Jochen Arndt
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...
General Programming
»
Uncategorised Quick Answers
»
General
MFC
GDI
VC++
Context Menu in Dialog based application
by
Jochen Arndt
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...
General Programming
»
Uncategorised Quick Answers
»
General
MFC
How to solve error: Heap block at 007A8530 modified at 007A860A past requested size of d2?
by
Jochen Arndt
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...
General Programming
»
Uncategorised Quick Answers
»
General
C++
VC++
Re: ShellExecute to post a command line to an existing cmd windows.
by
Jochen Arndt
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:
General Programming
»
C / C++ / Mfc
Re: Catch OnLButtonDblClk in CMainFrame
by
Jochen Arndt
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
General Programming
»
C / C++ / Mfc
Enable/disable button based on cd/dvd tray position
by
Jochen Arndt
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...
General Programming
»
Uncategorised Quick Answers
»
General
MFC
VC++
Re: Unicode CString and fopen problem
by
Jochen Arndt
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"));
General Programming
»
C / C++ / Mfc
Re: Windows Service Controler & CAsyncSocket
by
Jochen Arndt
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
General Programming
»
C / C++ / Mfc
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.
General Programming
»
C / C++ / Mfc
Page 1 of 15
1
2
3
4
5
6
7
8
9
10
First
·
Prev
·
Next
·
Last
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