|
Hi,
I'm struggling with a problem. I want to catch a 'WM_COPYDATA' event that occurs in a C# application.
I send a data from a C++ application. The bridge is correctly done I think.
So, sometimes it works, usually when my C# application is active.
But most of the time, it doesn't work, because when trying to catch the appropriate WM_COPYDATA message in WndProc overrided method of my C# application, the program stays catching a couple of other messages like: WM_WINDOWPOSCHANGED, WM_ACTIVATEAPP, WM_NCACTIVATE, WM_ACTIVATE and so on.
Doing so, it almost never catch the WM_COPYDATA message that I sent from my C++ application.
Can you help me please ?
Thanks.
P.S.: I catch messages in my C# application like this:
protected override void WndProc(ref Message m)
{
string g = m.ToString();
if (m.Msg == WM_COPYDATA)
{
// instructions.
}
}
p.f. Goudjo-Ako
Bringing our energy together !
|
|
|
|
|
You should ask this on the C# board[^]
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks Mark, I dit it.
p.f. Goudjo-Ako
Bringing our energy together !
|
|
|
|
|
Ok Im not exacly a newbie I have read a book alomst front to back on C++ (C++ With Out Fear, Brian Overland) and I do not know what to do next. I really wanna make something, I have had a intrest in C++ since I was like 11 (17 now) I was never really good in math or real problom sovling but it helps if its something I can actually interact with like a lab book or something. I am self-teaching myself and I am really tired of reading. I took a break for like a month an here I am I REALLY want to learn this and Im willing to do really about anything, and I know it will take time but Im hoping to be able talk make real programs soon. Well Im a senior in hight school to graduate in like 3 weeks so I have time to dedicate...I know alot about computers so if someone that knows some stuff about C++ help me like point me what to do next, or good interactive stuff or something I would really like that, you can ether reply here or AIM\e-mail at cgsarebeast@drivehq.com.
Thanks a ton,
JD
(Srry if not the right bored I don't know were else to put it)
|
|
|
|
|
Start with some programs that use cout/cin to take input, display output to the console. Something easy would be a math program that asks you for a few numbers, asks you for the operation, and then performs the operation on all the numbers.
If you're just starting out, then you probably won't be looking at any Managed C++, unless you want to work with a GUI (but I wouldn't advise getting to that until you have a better handle on the basics).
|
|
|
|
|
I pretty much have a handle on the basics. An I kinda do wanna do somesort of GUI but Idk were to start on that.....
Thanks,
JD
|
|
|
|
|
He was telling you that you're in the wrong forum. C++/CLI is not plain C++. You want the Visual c++ forum. If you want to write GUI code in C++, you need to learn MFC, probably. You can use C++/CLI and Winforms, but it's not pretty, and not many people use it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Ok.........that doesnt really help, an I chose this 1 I dont want Visual C++ ether I guess this site isnt a good place 4 what Im lookin 4...Reg C++....thats all I wanted.......If ur gunna say this post is n the wrong spot or flame me n any way leave it......but if there is any 1 here that can answer my question......I would like that......well thats all I have to say :\
|
|
|
|
|
Frogboy181 wrote: an I chose this 1
This forum is for C++/CLI questions. Lots of people make the mistake, despite the notices on the subject in the header of the forum. I guess they gloss over what they don't know
Frogboy181 wrote: I dont want Visual C++ ether
Why not ? It's the forum for 'standard' C++ questions, although the focus is on the Microsoft compiler, and GUI related questions tend to be MFC. The C++ standard has no provisions for any sort of GUI. So, you need to choose a vendor specific library if you want a GUI. MFC is the most popular/common one, if you're coding for windows. If you're coding for Linux then yes, there are probably better places to ask. MFC is sort of on it's last legs, however, C++/CLI/Winforms development is pretty rare, and not a good path to go down.
Frogboy181 wrote: If ur gunna say this post is n the wrong spot or flame me n any way leave it..
Why do you think I'm telling you it's in the wrong spot ? It's because you're in the wrong place. Look around you. 50% or more of replies in this forum say 'you're in the wrong place'. Look at the dates, then look at the Visual C++ forum. This forum is a bit of a ghost town. I am trying to tell you that if you ask in the right forum, you'll get more help.
Although your question is super vague. I'd recommend considering C# if you are hoping to write GUI apps for windows, it's just easier to find resources, and easier to use/more powerful.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
The place for regular C++ questions at The Code Project is here[^].
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hiya
I would like to know 2 different methods of image resizing. One simple and one complex.
And then i have to implement those methods via programming in C++.NET.
And it would be great if some one could refer me some source code to understand it in detail. I am newbie to Image Processing.
Thanks a lot....
|
|
|
|
|
#using <System.Drawing.dll>
using namespace System;
using namespace System::Drawing;
using namespace System::Drawing::Drawing2D;
using namespace System::Drawing::Imaging;
...
Bitmap ^pSrcBitmap = gcnew Bitmap("C:\\test.bmp");
Int32 DestImageWidth = pSrcBitmap->Width * 2;
Int32 DestImageHeight = pSrcBitmap->Height * 2;
Bitmap ^pDestBitmap = gcnew Bitmap(DestImageWidth, DestImageHeight, pSrcBitmap->PixelFormat);
Graphics ^pDestGraphics = Graphics::FromImage(pDestBitmap);
pDestGraphics->InterpolationMode = InterpolationMode::HighQualityBicubic;
pDestGraphics->CompositingMode = CompositingMode::SourceCopy;
pDestGraphics->DrawImage(pSrcBitmap, 0, 0, DestImageWidth, DestImageHeight);
pDestBitmap->Save("C:\\testresized.bmp");
#using <System.Drawing.dll>
using namespace System;
using namespace System::Drawing;
using namespace System::Drawing::Drawing2D;
using namespace System::Drawing::Imaging;
...
Bitmap ^pSrcBitmap = gcnew Bitmap("C:\\test.bmp");
Int32 DestImageWidth = pSrcBitmap->Width * 2;
Int32 DestImageHeight = pSrcBitmap->Height * 2;
Bitmap ^pDestBitmap = gcnew Bitmap(DestImageWidth, DestImageHeight, pSrcBitmap->PixelFormat);
BitmapData ^pSrcBitmapData = pSrcBitmap->LockBits(Rectangle(0,0,pSrcBitmap->Width,pSrcBitmap->Height),
ImageLockMode::ReadOnly, pSrcBitmap->PixelFormat);
BitmapData ^pDestBitmapData = pDestBitmap->LockBits(Rectangle(0,0,DestImageWidth,DestImageHeight),
ImageLockMode::WriteOnly, pSrcBitmap->PixelFormat);
<code>
pSrcBitmap->UnlockBits(pSrcBitmapData);
pDestBitmap->UnlockBits(pDestBitmapData);
pDestBitmap->Save("C:\\testresized.bmp");
-- modified at 12:56 Tuesday 5th June, 2007
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
What methods are these. Well is the complex one bilinear interpolation method.
If its not then is it possible for you to tell me with bilinear interpolation one. And yeh it would be great if you could provide me with few good links aswell to underrstand the theory behind it...
As i have to compare the both methods...and point out advantages n disadvantages of both...
Thnaks
|
|
|
|
|
|
My image processing articles cover bilinear interpolation. You'd have to convert the code from C#, which should be easy.
I cover the theory, also. There are on this site.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sorry Christian!
I forgot about this article[^]. I'll try and remember to post the link in the future
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
OK great...Thanks ....Ill go through it and would try to figure out advantages n disadvantages of 2 different approach...a simple and a bilinear one....
Thanks a lot..
|
|
|
|
|
Software_Specialist wrote: a simple and a bilinear one
I didn't mention, a simple solution is to duplicate pixels when increasing size and remove pixels
when reducing size, not taking into consideration nearest neighbor or anything.
This is the easiest to code but the resulting image, especially when increasing size, is the
poorest (pixelated, "blocky").
Good luck!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Are you using C++/CLI, or vanilla C++ in VS2005 ? You also seem to be asking people to do an assignment for you, why can't you find this info for yourself ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
what...?
I never asked any one to do my assignment....???? It could be a part of assignment but not the whole assignment...??????? But it is not any assignment...i am just startin teaching myself IP...so its a step1. Yeh but to get started i read this question somewhere...
I did find this info myself aswell...d only reason i put this up was bcos i was not sure of the different methods ...later i found out that bilinear interpolation is one of d complex method...so to make sure i ws right i put up a question here......And its always better to take some pre info before you start working over any new area and thats wt i did.. I am starting up with Image processing , speech processing and stuff...And i guess its right to ask some one experienced like urself....who could push me to the right direction....I mostly work over C#.net and recently only i started with MFC n all...
Anyway from next time i would mention what all info my google friend gave me and in what area i am confused...
Thanks for replying to my post...Problem solved.....
SS
|
|
|
|
|
does anyone know how to copy data from one listbox(several columns) to another one?
Thanks In Advance;
|
|
|
|
|
If this is .NET, then the listboxes have an Items property. If it's not .NET, you'r in the wrong forum
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello every body ..
If you can I need a cod to search in a text file ....
I need it to search of word which contin of 3 word ..
can you help me I try but I cant write it ...
plase help me as soon as you can ...
non light
|
|
|
|
|
This is the C++/CLI forum. Try the Visual C++ forum, but first try doing a little research. You should ask a question which explains what you've tried. The fstream class is the best way to read a file, and you can read a file word by word with it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
#include<iostream>
#include<string>
#include<cmath>
using namespace std;
class Complex{
public:
Complex();
Complex(double);
Complex(double,double);
void write() const ;
bool operator==(const Complex& ) const ;
bool operator!=(const Complex& ) const ;
Complex operator-();
friend ostream& operator<<(ostream& out,Complex& c);
private:
double real;
double imag;
};
Complex::Complex(){
real=imag=0.0;
}
Complex::Complex(double re){
real=re;
imag=0.0;
}
Complex::Complex(double re,double im){
real=re;
imag=im;
}
void Complex::write() const {
cout<<real<<"+"<<imag<<'i'<<endl;
}
bool Complex::operator==(const Complex& u ) const {
if(real==u.real&&imag==u.imag)
return true;
else return false;
}
bool Complex::operator!=(const Complex& u ) const {
if(real!=u.real||imag!=u.imag)
return true;
else return false;
}
Complex Complex::operator-(){
real=-real;
imag=-imag;
}
ostream& operator<<(ostream& out,const Complex& c)
{
return out<<c.real<<"+"<<c.imag<<'i'<<endl;
}
int main(){
Complex c1(2.3,5.6);
Complex c2(1.4,2.5);
if(c1==c2) {
c1.write();
c2.write();
cout<<c1<<endl;
cout<<c2<<endl;
}
return 0;
}
I have declared :friend ostream& operator<<(ostream& out,Complex& c);
but why the error says:
cannot access private member declared in class 'Complex'?
|
|
|
|