|
|
You could create a region around the picture and then use PtInRegion in your WM_MOUSEMOVE handler to check if the mouse is over the picture. If it is then you can make the alterations to the picture, if not leave it as is.
Hope this is of some help.
|
|
|
|
|
Hi everybody. Some of you helped me quite a lot since I became a Code Project member. Some of you also know that this help of yours goes in a good cause: I'm working at a freeware which I consider that will be my gift to all of you people that help others on forums. It's not something spectacular, but not something little either.
In the meantime however, I decided that I can give something back sooner, since my freeware is still not completed. An article. I'm thinking about writing an article about how to link Visual C++ with a VB application and viceversa. With all sorts of neat tricks that I learned in the past months. This could be a good resource for programmers that know both languages and want to benefit from the advantages of linking them.
Before I write my article I have one more final question. So that I don't write stupid things.
Is it possible to call a function in a Visual Basic EXE (Application) from a Visual C++ EXE while both applications are running?
OR: Is it possible to call a function in ANY exe from Visual C++? Not necesarily a VB. Something else.
I KNOW that calling a function in a VB DLL, FROM Visual C++ IS possible. But I need to know if this stands true for EXE.
Please answer only if you know the absolute sure answer. Your answer will influence me about how to write the article.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas wrote:
I KNOW that calling a function in a VB DLL, FROM Visual C++ IS possible. But I need to know if this stands true for EXE.
Nope, Unless EXE is ATL SERVER Executable!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
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
|
|
|
|