|
This is a general answer, cause like a lot of things the devil is always in the details. But you can call a function from any executable file when coding in any environment if the following three conditions can be met.
1) The function is exported from the executable file.
2) The calling convention of the function is known and your programming environment supports that calling convention.
3) The signature of the function is known. ie. What does the function return, what is it's name and what parameters does it require.
Usually, regardless of the file being an EXE, a DLL or any type of executable, if you can satisfy all three of the above you should be able to call the function. Oh and if I've forgot something, just blame it on my three Guinness lunch.
Oh and good luck with your article.
Chris Meech
I am Canadian. [heard in a local bar]
Remember that in Texas, Gun Control is hitting what you aim at. [Richard Stringer]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
Hm. But Visual Basic can't built EXE like C++. C++ I know that has that "def" file which can allow you to specify export functions. Or you can use "dll_export" or something like this. So practically, the only way you can call a function from VB is to make some DLL, not EXE.
Right?
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas wrote:
So practically, the only way you can call a function from VB is to make some DLL, not EXE.
Nope, You can call Method/Property from Interface exposed by OutProcess Server Executable (i.e. Executable based COM/ATL)!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
i am having a dialog. i am displaying a bitmap using picture control on the dialog.i am editing the bitmap using pen tool and fill color tools etc. i want to save this edited bitmap in icon and bitmap format. are there any articles on this.
regards
laiju
|
|
|
|
|
i have an instance of OpenCv image library where a struytue is defines as
typedef struct _IplImage {
int nSize; /* size of iplImage struct */
int ID; /* image header version */
int nChannels;
int alphaChannel;
int depth; /* pixel depth in bits */
char colorModel[4];
char channelSeq[4];
int dataOrder;
int origin;
int align; /* 4- or 8-byte align */
int width;
int height;
struct _IplROI *roi; /* pointer to ROI if any */
struct _IplImage *maskROI; /*pointer to mask ROI if any */
void *imageId; /* use of the application */
struct _IplTileInfo *tileInfo; /* contains information on tiling
*/
int imageSize; /* useful size in bytes */
char *imageData; /* pointer to aligned image */
int widthStep; /* size of aligned line in bytes */
int BorderMode[4]; /* the top, bottom, left,
and right border mode */
int BorderConst[4]; /* constants for the top, bottom,
left, and right border */
char *imageDataOrigin; /* ptr to full, nonaligned image */
and is used in the main as
int main( int argc, char** argv )
{
IplImage* src;
my question what exactly does the underscore before the IplImage structure represent.
regards
|
|
|
|
|
prat78 wrote:
what exactly does the underscore before the IplImage structure represent
nothing. an underscore is just another character you can use in variable names - it has no special meaning in C/C++.
whoever created the IplImage structure might have been following some coding standards that gave special significance to names that start with underscore (similar to the Hungarian notation for naming variables to reflect their type: bool bFlag; int iCounter; CString csText;, etc). but that is something you'd have to figure out from whatever documentation you have.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
prat78 wrote:
my question what exactly does the underscore before the IplImage structure represent.
It frequently means that the object is Microsoft-specific, or that it is used internally.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
In going over to Visual Studio 7, I get a new error.
CArray, GetSize() returns an INT_PTR instead of an int.
Up until now an int was a 32 bit number.
What is an INT_PTR?
For my applications a 32 bit integer is enough.
Can I somehow globally define something to get rid
of this warning?
Thanks,
Ilan
|
|
|
|
|
IlanTal wrote:
What is an INT_PTR?
Pointer to Integer
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
|
My Little Finger Type Faster
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
So next time you'll have to write with your nose
|
|
|
|
|
cedric moonen wrote:
So next time you'll have to write with your nose
Oh, I Can try but My Spects create Problem
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
that's ok for me !
wow, i'm still 10 minutes late... Alok's really too fast... i cannot contest :->
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
No thats not it either...
Blog[^]
|
|
|
|
|
Hello,
an INT_PTR is NOT a pointer to an int! It is basically an int. If you compile under 32 bit, the INT_PTR is __int32, if you compile under 64 bit, it is an __int64. This is because the default size of an int is 64 bits on a 64 bit compiler instead of 32 bits.
The main advantage of the INT_PTR is that you get the same warnings when you ocompile under a 32 bit compiler as if you were compiling under a 64 bit compiler. This helps you to prepare to write portable code for the 64 bit platform.
If you are not planning to write portable code, you can simply ignore those warnings or #pragma them away:
<br />
#pragma warning(disable : /*warning number here: 4003*/)<br />
Hope this helps
Blog[^]
|
|
|
|
|
HI Bob,
Here what My local copy MSDN (OCTOBER 2001) state About INT_PTR
"
INT_PTR Signed integral type for pointer precision. Use when casting a pointer to an integer to perform pointer arithmetic.
"
May be defination of INT_PTR changed in RECENT Releases!.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Here is the declaration from the VS2005 library:
typedef _W64 int INT_PTR, *PINT_PTR;
I just love the PINT_PTR type
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
VS2005 library:
Thats why I mention, I have MSDN October 2001 Edition!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
That version doesn't get updated anymore. I still have it too, but if I need to know something about other things than api's, I use MSDN online.
It's difficult to find the definition of INT_PTR on MSDN online, since it gives you results with every function returning an INT_PTR..
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
I just love the PINT_PTR type
It's a pointer to a pint - tells us where to go after work
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
Bob Stanneveld wrote:
This is because the default size of an int is 64 bits on a 64 bit compiler instead of 32 bits.
Nope. int is still 32 bits on a 64 bit compiler. The explanation for INT_PTR can be found here[^]:
If you must cast a pointer to test some bits, set or clear bits, or otherwise manipulate its contents, use the UINT_PTR or INT_PTR type. These types are integral types that scale to the size of a pointer for both 32- and 64-bit Windows (for example, ULONG for 32-bit Windows and _int64 for 64-bit Windows).
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|