|
I bet you didn't create your window with a menu. Thus trying to get the menu fails.
Just use LoadMenu to get the menu you wish to display from your resource file. Don't forget to get one of the sub menus.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I dont know how to use it ,can you give me a instance??
thanks a lot!!
|
|
|
|
|
Hi Ilavl,
Perhaps you can provide which TransparentBlt() function your using? There is two that I know of. The class CDC has one, CImage has one also and they both take different parameters.
Also one of them has a bad memory leak that can render the system useless. Off the top of my head I can't remember which one or if MS has fixed this or not. A quick search on http://msdn.microsoft.com/ should help. Let me know and I'll help you out. Cheers
|
|
|
|
|
TransparentBlt can be used to paint a picture from one DC (the source) to another (the destination). The special thing about it is, that you can designate a specific color to be transparent. Any pixel on the source DC with that specific color, will not be copied.
It purpose was to supersede older BitBlt hassle with masks.
if you have a DC ready with an image you want to place on a windowDC, and this image has the color black designated as transparent, this code would probably work:
In your message handler:
case WM_PAINT:
TransparentBlt(
(HDC) wParam, // your window DC
0, // Dest. x
0, // Dest. y
220, // width of picture on destination
440, // height of picture on destination
hdcSrc, // Source DC
0, // Source x
0, // Source y
220, // width of picture on source
440, // height of picture on source
RGB(0,0,0) // Macro, specifies the color black
);
if source and destination heights and widths differ, TranparentBlt stretches the source image to fit the size specified for the destination...
If you need more help concerning this, you could, if you like, email me the piece of source you're having trouble with...
Georg Haan (.Netherlands)
|
|
|
|
|
Hello Georg,
Do you know how can i draw transparent image with IPicture object ?
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I've created a DLL but how can I call all my functions in that DLL from an EXE?
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
MFC or ATL?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Well, I want to do it with Win32 or MFC.
Can you show me in Win32, do that!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
So you mean you use Win32 Dynamic-Link Library project ro write dll?
So first as you now you have to register your dll.
include your yourdll_idl.h and yourdll_idl_i.c in your class,then you can use your methos:
Is that enough or you need more?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
1) Add lib file produced by DLL project to exe project: Project - Settings - Link - Object/library modules
2) Include exported h-file to your exe project
3) Call Dll functions
4) Ensure that Dll is available in runtime via PATH.
|
|
|
|
|
Hello, the codegurus around the world.
There are at lease two ways to call the functions in DLL.
One is to use LoadLibrary and GetProcessAdoc(?) to get
the address of the function in DLL.
The other way is to implicity call the function in DLL
by registering the function name in DLL at def file.
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
Aah!
The first way you said was exactly what I was looking for!
I post a new message if I get some trouble with the functions... thnx
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Well, I have a question right now:
What kind of type will my varible that holds the address have?
I can't declare a:
FARPROC myfunc = GetProcAddress(....);
and then call my function:
myfunc();
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Declare a function pointer that has the same prototype of the function that you want to call:
Example:
<br />
int GetWindowText(HWND hWnd, LPTSTR lpString, int nMaxCount);<br />
<br />
int (*GetWindowTextPtr)(HWND, LPTSTR, int);<br />
<br />
FARPROC myfunc = GetProcAddress(....);<br />
<br />
GetWindowTextPtr func = (GetWindowTextPtr)myfunc;<br />
<br />
myfunc(hWnd, szString, count);<br />
|
|
|
|
|
Hey guys i am writing a quick bit of software for my electronics that converts a bitmap to pure binary ie puts the first line at the begginning and removes the bitmap header. I wanted to display this datd again in the software so i could check the image being stored but i can't seem to find a control that lets me to turn a pixel on or off or has a grid where i can make each cell balck or white.
Basically what i need to do is have a grid of 256x256 where i can control each pixel to be white or black so on or off.
Cheers
Peter
|
|
|
|
|
Hello,
I'm looking for the Liposuction32 tool (http://www.microsoft.com/msj/defaulttop.asp?page=/msj/archive/s572.htm). The link has been removed from the article...
If anyone has it..
Thanks
|
|
|
|
|
This link has it.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi!
I am writing UNICODE application. Everything works fine, apart from list boxes. When I add russian/japaneese string to the listbox I receive garbage in dialog. It works ok for english. It seems to me that CLIstBox does not handle properly UNICODE strings.
I also tried:
LCID mylcid = MAKELCID(MAKELANGID(LANG_RUSSIAN, SUBLANG_NEUTRAL), SORT_DEFAULT);
m_theListBox.SetLocale(mylcid);
_ASSERTE(m_theListBox.GetLocale() == mylcid);
and I get assertion.
Does anyone know, how to put russian/japaneese string into the list box?
(I am using WindowsXP Pro)
Thanks in advance
|
|
|
|
|
Make sure the control's font is set to something that supports the character sets you're using, such as Tahoma. If it's MS Sans Serif, the non-Latin characters will not show up right.
--Mike--
Fetchez la vache!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
Hi
I need some code that stops my program from loading up the mainframe when it is starting. Because I want it to wait while my splash-screen is showing. Is it possible?
Thanks
|
|
|
|
|
Take a look at CYourApp::InitInstance() . This is the appropriate place to inject a splash window and wait for it to terminate before proceeding with the rest of the program.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You can create non-modal splash window just at very beginning.
Proceed with application initialization, and then terminate splash dialog. You can also set a timer.
This will not block application when splash screen will be displayed.
|
|
|
|
|
I think you can set timer!
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I am trying to debug my program because while running my driver program i encounter a bug and the error that the computer tells me is this:
" Unhandled Exception in Tictactoe.exe: 0x000005: Access violation"
this error occurred in my destructor for my CBoard Class
CBoard::~CBoard()
{
delete mpDefaultPen; <-- what is causing a exception to be thrown?
}
oh i used this pointer in my function
// Changes the Line color to the value entered
void CBoard::SetLineColor(CDC* pDC, COLORREF color)
{
// Sets color to mLine color
mLineColor= color;
// Construct a pen
mpPen = new CPen;
VERIFY(mpPen);
VERIFY(mpPen->CreatePen(PS_SOLID,5,mLineColor));
VERIFY(mpDefaultPen = pDC->SelectObject(mpPen)); <-- rite here
}
Does anyone know whats causing this bug to occur? anyways... thank you in advance for helping me... i very much appreciate all the help
|
|
|
|
|
You shouldn't delete mpDefaultPen , but rather select it back to pDC with SelectObject once you're done with the DC object. Check your documentation for SelectObject . The general scheme is as follows:
mpDefaultPen =pDC->SelectObject(mpPen);
pDC->SelectObject(mpDefaultPen);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|