Click here to Skip to main content
15,884,298 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Creating a Time Provider in C++ Pin
bijumanjeri10-Sep-09 5:30
bijumanjeri10-Sep-09 5:30 
GeneralRe: Creating a Time Provider in C++ Pin
David Crow10-Sep-09 5:42
David Crow10-Sep-09 5:42 
GeneralRe: Creating a Time Provider in C++ Pin
bijumanjeri10-Sep-09 5:50
bijumanjeri10-Sep-09 5:50 
AnswerRe: Creating a Time Provider in C++ Pin
Randor 10-Sep-09 6:02
professional Randor 10-Sep-09 6:02 
GeneralRe: Creating a Time Provider in C++ Pin
bijumanjeri10-Sep-09 18:31
bijumanjeri10-Sep-09 18:31 
QuestionUsing void* to keep track of an external object. Pin
RedSonja10-Sep-09 4:15
RedSonja10-Sep-09 4:15 
AnswerRe: Using void* to keep track of an external object. Pin
Richard MacCutchan10-Sep-09 7:43
mveRichard MacCutchan10-Sep-09 7:43 
GeneralRe: Using void* to keep track of an external object. Pin
RedSonja10-Sep-09 20:50
RedSonja10-Sep-09 20:50 
Sorry, I was not very clear:
I hop into B by calling a function B declares as DllExport, and A sees as DllImport. B has a dll and a lib and A can see them. This has always worked OK when I called it "fresh" every time.

B's internal objects - static instances of B's classes - seem to be null when I go into B using the void* - I get the buffer overrun when I call functions of an internal object. (I am not allowed to use dynamic allocation "because the code is safety critical". This makes things very hard.) When I call B I import the stuff like this:

DllExport int BDoWork(
struct BigDataBlock1 *pBigDataBlock1,
struct BigDataBlock2 *pBigDataBlock2,
void* pB)

I turn the void* back into a proper pointer like this:

BWrapper* pmyB = (BWrapper*)pB;

and it works OK, I can import data along with the pointer, and it seems to be alright, I can copy the data into B's internal structures. I use ASSERT when copying.

B was written by myself. Respectable code always has a few bugs. I am sure there are still a few in there. What should I be looking for? It imports and handles very large amounts of data; I already had to cut the data into slices to avoid overflowing buffers on the dll call. I made it a dll so I could go into B with the debugger when debugging A. (Visual Studio is cool; it can even hop into Ada dlls, can you imagine?)

You helped me a lot by saying void* should work the way I use it. Now I suppose the bug is inside B so I can concentrate there.

-------------
Ave computer! Hackitura te salutat!
(I just made this up. Just to show you can hack Latin as well as C++.)

GeneralRe: Using void* to keep track of an external object. Pin
Richard MacCutchan11-Sep-09 1:19
mveRichard MacCutchan11-Sep-09 1:19 
GeneralRe: Using void* to keep track of an external object. Pin
RedSonja17-Sep-09 20:41
RedSonja17-Sep-09 20:41 
QuestionSerial port behaviour in XP and windows 2000 Pin
sunny_vc10-Sep-09 2:50
sunny_vc10-Sep-09 2:50 
QuestionRe: Serial port behaviour in XP and windows 2000 Pin
CPallini10-Sep-09 3:06
mveCPallini10-Sep-09 3:06 
AnswerRe: Serial port behaviour in XP and windows 2000 Pin
sunny_vc10-Sep-09 3:18
sunny_vc10-Sep-09 3:18 
AnswerRe: Serial port behaviour in XP and windows 2000 Pin
Marcelo Miacca10-Sep-09 14:10
Marcelo Miacca10-Sep-09 14:10 
QuestionSome libraries are missing in my command line project linker settings in vc++ code in vs-2008...!? Pin
Vetukuri Raju10-Sep-09 2:47
Vetukuri Raju10-Sep-09 2:47 
AnswerRe: Some libraries are missing in my command line project linker settings in vc++ code in vs-2008...!? Pin
Randor 10-Sep-09 4:20
professional Randor 10-Sep-09 4:20 
GeneralRe: Some libraries are missing in my command line project linker settings in vc++ code in vs-2008...!? Pin
Vetukuri Raju10-Sep-09 4:25
Vetukuri Raju10-Sep-09 4:25 
GeneralRe: Some libraries are missing in my command line project linker settings in vc++ code in vs-2008...!? Pin
Randor 10-Sep-09 4:40
professional Randor 10-Sep-09 4:40 
GeneralRe: Some libraries are missing in my command line project linker settings in vc++ code in vs-2008...!? Pin
Vetukuri Raju10-Sep-09 5:37
Vetukuri Raju10-Sep-09 5:37 
GeneralRe: Some libraries are missing in my command line project linker settings in vc++ code in vs-2008...!? Pin
Randor 10-Sep-09 5:53
professional Randor 10-Sep-09 5:53 
GeneralRe: Some libraries are missing in my command line project linker settings in vc++ code in vs-2008...!? Pin
Vetukuri Raju14-Sep-09 22:48
Vetukuri Raju14-Sep-09 22:48 
GeneralRe: Some libraries are missing in my command line project linker settings in vc++ code in vs-2008...!? Pin
Vetukuri Raju11-Sep-09 1:50
Vetukuri Raju11-Sep-09 1:50 
GeneralRe: Some libraries are missing in my command line project linker settings in vc++ code in vs-2008...!? Pin
Randor 11-Sep-09 4:32
professional Randor 11-Sep-09 4:32 
GeneralRe: Some libraries are missing in my command line project linker settings in vc++ code in vs-2008...!? Pin
Vetukuri Raju11-Sep-09 5:07
Vetukuri Raju11-Sep-09 5:07 
QuestionHow to get network connection speed WinXP using C & WinAPI Pin
mikey_eff10-Sep-09 2:44
mikey_eff10-Sep-09 2:44 

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.