LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

int64 runtime error

Solved!
Go to solution

I am recompiling an existing CVI project in CVI2015 as part of a move from XP to Win7, and as it is a 64bit Win7 I am also moving from 32bit to 64bit.

All the dll's and .exe bulid OK with no errors.

But when I come to run the top level GUI, a debug  .exe file, I get FATAL RUN TIME ERROR found pointer to int expected pointer to __int64.

Should the compiler have fixed this for me?

The variable in question is &hWnd which is declared as an int and passed to GetPanelAttribute.

I assumed the same code should build either 32 or 64.

Is there something I am missing?

David

0 Kudos
Message 1 of 3
(2,850 Views)
Solution
Accepted by topic author David_Stevenson

Window handles are 32-bit values in a 32-bit program and 64-bit values in a 64-bit program. You should declare it as an intptr_t, which will be correct for both bitnesses 

 

The compiler can usually catch these types of errors, but in this case I'm assuming that you are passing it to GetPanelAttribute, in which case the compiler can't catch this since this function declares that parameter as a void * (since that function is used to get attributes of different types). Therefore, you have to pick the correct data type for the attribute that you're using. If you use the wrong type, the debugger will report the error that you saw.

0 Kudos
Message 2 of 3
(2,741 Views)

Thanks for the clear explanation of why the compiler can not fix this one.

 

0 Kudos
Message 3 of 3
(2,730 Views)