Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Feb 25, 1:05*pm, Chip Pearson wrote:
No, there is no type checking, not even ByRef/ByVal checking. If you pass a value to a C parameter that requires an address, you'll blow up. In your specific example of a VBA Long passed to a C++ enum, you're probably alright (32-bit), but that is the exception to the rule, since under the hood the enum is just a 32-bit integer. *DLL functions referenced via a Declare are completely outisde and independent of VBA's internal type conversions, error hanldling, and other hand-holding. Such functions are very unforgiiving. Screw it up and Excel will crash. Note, also, that in order to use a DLL function written in C++ from VBA, that function must have been compiled with the __stdcall directive. Cordially, Chip Pearson Microsoft Most Valuable Professional, * * * * Excel, 1998 - 2010 Pearson Software Consulting, LLCwww.cpearson.com On Thu, 25 Feb 2010 11:50:43 -0800 (PST), l h wrote: I'm new to VB/VBA and calling functions in external DLLs from VB/VBA. If I declare a variable in VBA, assign a value and then call a C++ function in a DLL, is any type checking down between VBA and the C++ function? So if I declare a Long identifier in VBA and then call a function that expects an enum type in C++, will the call be flagged for type mismatch? Thanks. Les Thanks for your help Chip. Les |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Type Mismatch error while checking range value | Excel Programming | |||
Checking formula type (reference to other worksheet or not) | Excel Discussion (Misc queries) | |||
Checking range of cells for entry then checking for total | Excel Programming | |||
Provide a way to turn off auto-checking excel formulas as I type t | Excel Discussion (Misc queries) | |||
Code works 1st time then Type Mismatch when checking for not blank cells | Excel Programming |