|
BitWare wrote: Sorry for being very new here, but where do I get details on how to upload the ZIP file of the source code and documentation?
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I find an evening couse called
Interop programming and Mixed Mode in C++ (unix and Windows)
near my home.
I think it is interesting, I may spend a little time to sit down to learn something new.
but introduction of the couse is too simple and I can't find its teacher to talk about.
I think someone here may know idea of the couse.
My questions are:
1. what does Interop mean? I guess the word is inter-operating-system, i.e. programming crossing windows and unix.
this tech for me is zero so far.
2. what does Mixed-Mode mean?
Hope u can explan by Windows programming, so it is easy for me to understand.
I don't know programming on unix, is it special for unix?
thx.
|
|
|
|
|
Mixed-mode is the mixing of managed and unmanaged code in the same assembly. Unmanaged code
is your old standard C++ code. Managed code uses a managed heap and allows access to the
.NET framework from C++ code.
There's lots of forms of interop, but relative to managed/unmanaged code, interop is
"interoperability", the ability to work with data across differing platforms, languages, and
systems. For example, managed C++ provides interop marshaling for passing managed objects
back and forth between managed and unmanaged code. One example is when you need to call a Windows
API that requires a pointer to an object, but you're calling from managed code and you only
have a managed pointer. Objects pointed to by managed pointers can be moved by the system at any
time and also may have data types that don't exist in the unmanaged world. In that case you need
to use interop marshaling so the API gets data it can work with (that doesn't move).
Just my 2 cents...
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi,
I want to find MMC's version installed on a system, is there any API or registry key?
Warm Regards,
Mushq
|
|
|
|
|
Mushq wrote: I want to find MMC's...
MultiMedia Card
Microsoft Management Console
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
sorry for inconvenience, it is "Microsoft Management Console", thanks for that
|
|
|
|
|
How about using the version-related functions on mmc.exe?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I would like to be able to turn on and off a bitmap in a dialog when a particular condition exists. I can create the bitmap but I can't seem to find out how to make it invisible when I dont want to see it. Can someone tell how to accomplish this?
Thanks,
Terry
|
|
|
|
|
how do u display your bitmap?
if u call RedawWindow() without displaying it, the bitmap is invisible.
|
|
|
|
|
I have created the bitmap through the dialog editor. I have an ID for the bitmap but am not able to change it's state. How do I implement RedrawWindow? GetDlgItem(IDB_BITMAP)->RedrawWindow(??)?
|
|
|
|
|
Bitmaps don't have a state, nor are they dialog controls. Is the bitmap being displayed in a control? If so, hide or show that control using ShowWindow(). If you are drawing the bitmap
yourself, don't draw it if you want it invisible.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Excellent thanks Mark. I did not realize what I was doing. I did use a picture control to display the bitmap. After you mentioned the bitmap being displayed in a control it clicked. When I used
GetDlgItem(IDC_MYCONTROL)->ShowWindow(SW_HIDE);
The bitmap was hidden and I can make it visible when I need it.
Terry
|
|
|
|
|
if you have a control for show bitmap you can use of ShowWindow(SW_HIDE|SW_SHOW); for visible or invisible.
|
|
|
|
|
I tried to change the state by using GetDlgItem(IDB_BITMAP)->ShowWindow(SW_HIDE); but I get an error at runtime but builds okay. I am sure I am missing something. I created the bitmap in the dialog editor and gave it an ID (IDB_BITMAP).
|
|
|
|
|
Thanks. Once I figured out what I was doing I was able to use ShowWindow(SW_HIDE) to hide the bitmap.
Terry
|
|
|
|
|
It seems its not your control does IDB_BITMAP a bitmap resource?what control do you use? CStatic or Button ...
and how did you create it?
-----------------------
Well I think you solved problem.
|
|
|
|
|
To answer your questions... Yes I was originally trying to do this with my bitmap resource "IDB_BITMAP", which was not working at all. I created a picture control which is CStatic I believe and added the bitmap resource to it. I did not realize what I had done until Mark had mentioned the control was what I needed to change and not the bitmap. Yes, I got it going now. Thanks for your responses.
Terry
|
|
|
|
|
hi im trying to code below, but is not working.
void update(HWND hwnd){<br />
<br />
HBITMAP pBitmap;<br />
pBitmap = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP1));
<br />
no errors it compiles fine just no window <br />
<br />
HDC pDC = GetDC(hwnd);<br />
HDC dcMem;<br />
dcMem = CreateCompatibleDC(pDC);<br />
COLORREF colour;<br />
colour = RGB(255,255,255);<br />
<br />
SelectObject(dcMem,pBitmap);<br />
<br />
BLENDFUNCTION blend;<br />
blend.BlendOp = AC_SRC_OVER;<br />
blend.BlendFlags = 0;<br />
blend.SourceConstantAlpha = 255;<br />
blend.AlphaFormat = AC_SRC_ALPHA;<br />
<br />
POINT ptSrc = {0, 0 };<br />
SIZE sz = { 270, 270 };<br />
<br />
int p = UpdateLayeredWindow(hwnd, NULL, NULL, &sz, dcMem, &ptSrc, colour, &blend, LWA_ALPHA );<br />
}
thank you
|
|
|
|
|
|
pBitmap = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP1)); //
^ this shows the window
Image* pBitmap = new Image(L"clockbg.bmp");
^ this does not
they are the same image loaded differently.
thank you
|
|
|
|
|
Lamefif wrote: Image* pBitmap = new Image(L"clockbg.bmp");
^ this does not
Maybe you need the full pathname of the file?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
And where's clockbg.bmp(path of file)?
|
|
|
|
|
the image is in my project folder and i know it loads because i can display it like this:
Bitmap bitmap(L"clockbg.bmp");
graphics.DrawImage(&bitmap, 0, 0);
and it shows
thanks
|
|
|
|
|
Bitmap is derived from Image.
If
Bitmap bitmap(L"clockbg.bmp");
graphics.DrawImage(&bitmap, 0, 0);
works, then
Image* pBitmap = new Image(L"clockbg.bmp");
graphics.DrawImage(pBitmap, 0, 0);
should work.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
i know Mark thats not my problem, but when i use GDI+ to load the image:
Image* pBitmap = new Image(L"clockbg.bmp"); or Bitmap.
as appose to:
HBITMAP pBitmap = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP1));
and i use it for my:
UpdateLayeredWindow(hwnd, NULL, NULL, &sz, dcMem, &ptSrc, colour, &blend, LWA_ALPHA );
the window doesn't show, as i've posted in the code above
is the same image and i now it loads, i dont now..
thank you
|
|
|
|