Click here to Skip to main content
15,916,398 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHow to Read a Registry Key Value Pin
J_E_D_I22-Feb-08 10:18
J_E_D_I22-Feb-08 10:18 
GeneralDetermine if an exe is running or not Pin
act_x20-Feb-08 10:01
act_x20-Feb-08 10:01 
GeneralRe: Determine if an exe is running or not Pin
David Crow20-Feb-08 10:44
David Crow20-Feb-08 10:44 
GeneralRe: Determine if an exe is running or not Pin
Chris Meech20-Feb-08 11:11
Chris Meech20-Feb-08 11:11 
GeneralRe: Determine if an exe is running or not [modified] Pin
User 238229221-Feb-08 3:22
User 238229221-Feb-08 3:22 
GeneralExtended MAPI in C, not C++ or C# Pin
panther8220-Feb-08 8:55
panther8220-Feb-08 8:55 
GeneralRe: Extended MAPI in C, not C++ or C# Pin
Member 75496021-Feb-08 5:37
Member 75496021-Feb-08 5:37 
GeneralRe: Extended MAPI in C, not C++ or C# Pin
Member 75496021-Feb-08 6:04
Member 75496021-Feb-08 6:04 
further...I would anticipate that you might need to interface to the legacy C code from the C++ code. In the C++ code mark the legacy C headers as C code:

// legacycode.h

extern int stableAPI(int icount);



// NewCppAPI.cpp

extern "C" {
#include "legacycode.h"
}

void CppFunction()
{
	// do new things
	std::vector <int> vNumbers;
	vNumbers.push(1);
	vNumbers.push(2);
	vNumbers.push(3);

	// call the stable code
	int iResult = stableAPI(vNumbers.size());
}

When you have to pass information to the legacy code, it can only pass C types; don't pass pointers to C++ types. Be sure you know who owns what memory. A simple solution is to write copy API's in the C++ code that are called by the legacy C code in the same way that windows API's do. You pass in a pointer to a buffer with a pointer to a length that is the size of the buffer. If the buffer is too small the function returns an error and set the length to the size needed:

int CopyCppData(char * pszBuffer, int * ilength);

QuestionWhat is the SafeArrayGetElement Equalent method in Unix Pin
Jahnson K20-Feb-08 8:42
Jahnson K20-Feb-08 8:42 
AnswerRe: What is the SafeArrayGetElement Equalent method in Unix Pin
CPallini20-Feb-08 21:15
mveCPallini20-Feb-08 21:15 
GeneralLocking and Unlocking LogFile Pin
sharanu20-Feb-08 6:32
sharanu20-Feb-08 6:32 
GeneralRe: Locking and Unlocking LogFile Pin
Mark Salsbery20-Feb-08 6:52
Mark Salsbery20-Feb-08 6:52 
GeneralRe: Locking and Unlocking LogFile Pin
sharanu20-Feb-08 20:16
sharanu20-Feb-08 20:16 
GeneralRe: Locking and Unlocking LogFile Pin
Mark Salsbery21-Feb-08 7:36
Mark Salsbery21-Feb-08 7:36 
GeneralRe: Locking and Unlocking LogFile Pin
James R. Twine20-Feb-08 7:12
James R. Twine20-Feb-08 7:12 
QuestionRe: Locking and Unlocking LogFile Pin
David Crow20-Feb-08 7:37
David Crow20-Feb-08 7:37 
QuestionHow to get a local printer status? Pin
Skywalker200820-Feb-08 5:16
Skywalker200820-Feb-08 5:16 
AnswerRe: How to get a local printer status? Pin
David Crow20-Feb-08 5:31
David Crow20-Feb-08 5:31 
GeneralRe: How to get a local printer status? Pin
Skywalker200821-Feb-08 6:09
Skywalker200821-Feb-08 6:09 
GeneralInstall which windows compoents before install Visual Studio 2003 Pin
akira3220-Feb-08 5:06
akira3220-Feb-08 5:06 
GeneralRe: Install which windows compoents before install Visual Studio 2003 Pin
Mark Salsbery20-Feb-08 5:41
Mark Salsbery20-Feb-08 5:41 
QuestionCannot get reference to Locked screen when the system is in RDP state Pin
Abdul_khaliq_20-Feb-08 4:42
Abdul_khaliq_20-Feb-08 4:42 
GeneralRe: Cannot get reference to Locked screen when the system is in RDP state Pin
James R. Twine20-Feb-08 7:21
James R. Twine20-Feb-08 7:21 
QuestionRe: Cannot get reference to Locked screen when the system is in RDP state Pin
Abdul_khaliq_20-Feb-08 19:49
Abdul_khaliq_20-Feb-08 19:49 
QuestionCompiles with VC6. Is this still available? Pin
Ylno20-Feb-08 4:14
Ylno20-Feb-08 4:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.