|
How can I insert into my project dialog a BMP from a resource and make it transparent ? I set up my BMP background to (255,0,255) and it doesn't turn to transparent. Should I call any function or something ?
Thanks in advance, Rafael.
|
|
|
|
|
Are you using the BitBlt function to render the image? In that case you shold switch to TransparentBlt. As far as I remember the last parameter to the function is the transparent color...
|
|
|
|
|
no I'm not using it, I don't even know what is it. I am programming with MFC but until now I ever have programmed graphical interfaces and what function should I call from MFC ?? Please help or tell me some web site where it is explained or something... thank you so much !!
|
|
|
|
|
|
My dear friend,I have such a big question that make me puzzle.
Now,there is a sinouce signal.I have to sample it.And,then ,store the sampling points.
My question is,in VC++,which functions can I use?And how can I accomplish the storage?Can you give me a example?
Thank you very much!
langzi54
|
|
|
|
|
Hi.
I want to use the XmlDocument (from the .Net framework) to download RSS files and parse them. This should be possible right? Or is there another object I should use?
When I try with XmlDocument it sometimes work, and sometimes don't... It's very strange... It crashes on the XmlDocument::Load function, and gives me an unhandled exception at blahblah.
The debug output gives me the following:
HEAP[TeotiTrayBuddy.exe]: HEAP: Free Heap block 4050cb0 modified at 4050da8 after it was freed
Unhandled exception at 0x77f75a58 in TeotiTrayBuddy.exe: User breakpoint.
I am trying to catch an XmlException which is what the Load function should throw...
Any ideas? I have just started up with .Net so it would not surprise me if I have taken the wrong approach. Any advice are welcome...
Regards,
Jaran
|
|
|
|
|
I want to move a static control when the left mouse button is down(over the static control) and I move the mouse in some direction using MFC? the Static control should move as many pixels as much as the mouse has moved.
Harshapaul
|
|
|
|
|
Use the WM_MOUSEMOVE message. Have a variable which keeps track of the previous mouse position, and set this after each move of the static control.
When you have calculated the translation of the static control, use the MoveWindow memberfunction of the static control.
I think this should work
|
|
|
|
|
hai all,
I am developing an application using GDI functionalities.
I have to draw ellipse on mouse move with dashed, dotted line styles.
Please help me.
With thanks,
arun a.c.
|
|
|
|
|
If you mean the border, then you just create a pen with the PS_DASHDOT style.
myPen = CreatePen(PS_DASHDOT,1,RGB(0,0,0));
INTP
|
|
|
|
|
the following code giving me runtime error but ignoring runtime error shows the desired window. wat is bad in the code n if any better solution using CreateEx()
CWnd* pWnd = new CWnd;
pWnd->Create(/*WS_EX_OVERLAPPEDWINDOW ,*/AfxRegisterWndClass(0,AfxGetApp()->LoadStandardCursor(IDC_ARROW),GetSysColorBrush(COLOR_WINDOW),NULL), "Hello", WS_POPUPWINDOW |WS_VISIBLE /*| WS_CAPTION*/,
CRect(700, 480, 800, 580), this,1234);
i m using this code in a button handler of dialog base application. any one can help
|
|
|
|
|
as follows, what should I do? thanks
class A
{
public:
void f(void (*g)(int), int i) const { (*g)(i); }
protected:
//must be virtual, some one inherit from it
virtual void g(int i) const { ; }
};
class B
{
public:
B() { pa = new A; }
~B() { delete pa; }
//my problem is here: the first argument pa->g
void fb() const { pa->f( (pa->g), 0); }
private:
A* pa;
};
|
|
|
|
|
in the destructor,
before delete pa, check if it has been allocated ( != NULL).
next, for your request, (pa->g) is effectively the address of your function...
if there is a problem, what does the error say ?
TOXCCT >>> GEII power
|
|
|
|
|
i dont think its possible to create a pointer to the member function and use it.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
hey,
i get a very strange compilation error when compiling these files in .net :
//message.h
class Message
{
public:
void GetMessage();
};
//message.cpp
#include "message.h"
void Message::GetMessage()
{
}
//point.h
#include "message.h"
class Point
{
Message m;
public:
void ShowMessage();
};
//point.cpp
#include "point.h"
#include <winsock2.h>
void Point::ShowMessage()
{
m.GetMessage();
}
void main()
{
}
i get this error:
d:\point.cpp(8) : error C2039: 'GetMessageA' : is not a member of 'Message'
d:\test\message.h(4) : see declaration of 'Message'
as you can see there is indeed no function named GetMessageA but i wrote GetMessage , where did this A come from?!?
if i don't including Winsock2.h everything works fine. what does Winsock2.h have to do with it?
|
|
|
|
|
Change the GetMessage function to another name and see what happens. Maybe it gets stacked when trying to access to GetMessage because it thinks that it may access to GetMessageA.
|
|
|
|
|
onece, I also encountered this problem, finally, all went well.
your code above can be compiled without any error, but if you add
some other initialization into one class A(it includes "1.h"), the other class B's implementation file must also include "1.h" for the implementation of object of A in the file.
|
|
|
|
|
Well I was pretty sure that the code above was right !!
Ok then !!
|
|
|
|
|
Some windows include files #define certain things so that you only write code once and it expands the function names out to the correct form. GetMessageA (IIRC) means it is the Ascii (or Ansi) version of GetMessage while if you set some compiler option your error message will change to GetMessageW (which is the Wide character version of the function).
This way you can write compile the code for ASCII and then recompile the same code and get a Wide character version which will allow better internationalisation.
If you #include the winsock2.h on all your files they will all get expanded out to GetMessageA and all will work, if you don't want that to happen then choose a different method name.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|
|
GetMessage is a #define for GetMessageA or GetMessageW depending on wheather you are using unicode or not...
you should declare a method name that is already defined by windows, instead chose some other name.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
thanks for all your answers. what i still don't understand is how is one supose to know what excaly are the functions "already defined by windows" in order to avoid reusing their names...
|
|
|
|
|
class _DSpreadSheet : public COleDispatchDriver
HWND glhTargetWnd;
glhTargetWnd is a ole's handle.
the ole is _DSpreadSheet.
if to get CButton point, that is simple.
CButton *p;
p = (CButton *)CWnd::FromHandle(glhTargetWnd);
I can try :
CWnd cwMe;
_DSpreadSheet Test;
LPUNKNOWN obj = NULL;
if(cwMe.Attach(glhTargetWnd)) //this is ok
{
obj = cwMe.GetControlUnknown(); //the obj is NULL !!!!!
//cwMe.GetControlUnknown() maybe error?
}
else
{
//error code
}
if(obj == NULL)
{
//error code
}
else
{
Test.AttachDispatch((struct IDispatch *)obj);//because obj is NULL, this code can not run
}
please help me!!!
How can I do?
|
|
|
|
|
I have traces of a protocol (say a point-2-point data/control protocol) stored in files. I am thinking of writing a protocol validator, checking for the syntactic correctness as well as the semantic correctness (the correct flow as specified in the Spec).
The checking rules are put in a separate file & the inference engine loads these rules and checks for the validity of the data (from the trace files).
[rules file] + [trace file] ---(Inference engine)----> result
This also has to be lean & fast. I am now doing a proto based on some ideas I have on how this can be done...
but, I'd appreciate any ideas from you people on how this can be efficiently done (or how this is actually done ).
Thx
|
|
|
|
|
how do you recursively search for a folder with a certain name? If anyone has source code please post it
I am pretty sure to use Cfilefind but then again this is why i am asking.
-Ryan M.
|
|
|
|
|
<br />
BOOL SearchFolder(CString folder)<br />
{<br />
CFileFind finder;<br />
CString strWildcard(folder);<br />
strWildcard += _T("\\*.*");
BOOL bWorking = finder.FindFile(strWildcard);<br />
CString str;<br />
while (bWorking){<br />
bWorking = finder.FindNextFile();<br />
if (finder.IsDots())<br />
continue;<br />
else if (finder.IsDirectory()){<br />
str = finder.GetFilePath();<br />
SearchFolder(str);<br />
}<br />
else{<br />
str=finder.GetFilePath();<br />
DoingFile(str);<br />
}<br />
}<br />
finder.Close();<br />
return TRUE;<br />
}<br />
Good luck.
|
|
|
|