|
how can i load a bitmap file to device context ?
how can i save a bitmap file from device context ?
|
|
|
|
|
CDC.SelectObject(MyBitmap)
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
//Updating somebody else's window
// ( win32 SDK - VC6 - Win 98/2k )
Hi Friends,
How can I make a "forceful update" of a window created by
another process.I use EnumChildWindows() to get the HWND of
the window in question,has some BitBlt() done to is HDC,but after
these gimmicks, I couldnt restore the original .However if I resize
this window or maximized another window , the defaced window
looks normal as it should be. What would a better solution this problem?.
- Frienldy -Dracula
|
|
|
|
|
Invalidate(TRUE)
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Invalidate(...) function updates the window but it is really not a forcible update to my knowledge. Use UpdateWindow(...) for a forcible update of a window.
|
|
|
|
|
Hi everybody
I'm currently developping a Http 1.1 Client in C++.
I try to send chunk encoded data to a very simple http 1.1 CGI server
I have written in c++ for testing.
here the http request message the client sends :
POST http://MyHost/cgi-bin/MyHttpSrv.exe HTTP/1.1\r\n
Host: MyHost\r\n
Transfer-encoding: chunked\r\n
Content-type: text/plain\r\n
\r\n
2\r\ngo\r\n
0\r\n
\r\n
My problem is that the server never responds anything. It seems to be
blocked.
My configuration :
- Win2000 Pro + Personnal Web Server (IIS 5.0 reduced version)
I have reduced the CGI to the simplier ... and nothing happens.
Here is CGI source code :
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
cout << "Content-type: text/html\r\n" ;
cout << "Content-Length: 9\r\n" ;
cout << "\r\n";
cout << "Server OK";
return 0;
}
If I post the same request to an equivalent ASP page, the server runs
correctly !!??
Has anyone a suggestion ?
Tx
Lsa
|
|
|
|
|
Does anybody know SetTermsrvAppInstallMode() and TermsrvAppInstallMode()
from KERNEL32.DLL are not documented by Microsoft. They seem to be the only way to progmatically set or determine whether a terminal server is in install mode. They have been documented in several places on the net (search google groups) and seem to work. Should I use them or is there a more correct way of doing it?
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
I was asked to develop something that'll show the user's logon network id on the task bar so it's always visible. The user must not be able to close or terminate this app. Sounds simple. It probably is if you know how.
I'm not a C++ developer yet. In fact, I'll be taking a C++ course in a couple of weeks for this purpose. I am, however, been developing for some years now, mainly in Visual FoxPro. I also programmed in Pascal.
We have Windows 2000 workstations in a Novell network. The task manager is protected, meaning that the users cannot ask for the task manager by CTRL+ALT+DELETE keys.
Now the question. Someone mentioned that a Windows service might be a better way of doing this. Is that so? Does anyone have an idea of how I would go about accomplishing this? Some sample codes would greatly help.
TIA,
VagaBond
|
|
|
|
|
There are several ways of accomplishing this, but I first have to ask what is the ultimate goal here? To simply put the user's name in a window on the task bar doesn't sound really useful (which implies that surely there is a higher purpose). What happens when a dozen or more apps are running and the task bar windows are very small, thus obscuring the user's name?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
The ultimate goal is that the network user id must always be visible. There are users in our company who have more than 1 network logon id's. Each logon id determines, among other things, network authorisations and drive mappings. Sometimes, users would call the help desk asking why they can't see certain files or folders, or why they can't delete a file, although they can open and view it. Actually, these problems are easy to solve. We'll just tell them which user id they used to log on and that's that. Easy, I said, but when it happens on a regular basis, then it's time to look for other solutions.
Showing it on the task bar was my idea. Our network id's are only 6 characters long. I figured it'll take a few open apps before the user id is NOT readable. It would also be nice if clicking on the user id on the task bar, a small window will open providing the user more than just his network logon id, his/her full name for example.
I hope this helps, David.
Regards,
Ed Bond
|
|
|
|
|
See if this is an acceptable solution:
http://www.winguides.com/registry/display.php/370/
I use it on all of my machines and it serves the purpose.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
David,
The solution you sent would pretty much work except for one thing. I should've mentioned it before, but I just didn't think of it.
You see, our desktop is clean. There are no icons whatsoever. Our desktops are protected that we can't even change our background images. The Start button is also protected. We can't create shortcuts in it. We are, however, provided with the NAL (Novell Application Launcher). Here we can create our own shortcuts, but only in a pre-determined folder. Needless to say, we can't do much on our desktop or the Start button.
Anymore ideas? So far you'll the only one who's coming up great ideas. I just wish I could use 'em.
Thanks,
Ed
|
|
|
|
|
I want to write a program which can determine the fundamental frequency Fo by the Cepstrum method. I can write a program which can calcul the cepstre in VC, data is in a wave file. But I cannot determine the F0. All I need is a code determine the Fo from the cepstre.
Can you show me a way or a source code to do that?
Thank you
|
|
|
|
|
I Googled for several of the keywords here and found a number of matches, all speech-related (http://tinyurl.com/tqsk). Most of them were thesis-type papers. I would be inclined to send an e-mail to the author of those papers and explain your situation. I'm feel confident that you'll be obliged.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi All
I have a doubt with TCP/IP programming.In windows 2000,if user Disables the NetWork connection,how the applications know about that disconnecion?Is there any message that windows broadcast to all the applications about this?How to handle this situation using CSocket?
Thanks and Regards
Krishna
|
|
|
|
|
Given that the network adapter is disabled, call WSAGetLastError().
Kuphryn
|
|
|
|
|
Hi,
I have a multi-view application which displays different view of the same 3D OpenGL object. Because it's the same 3D object for all views, I just need to build the display list (using glNewList) once. The call list is build is the CMainFrame class.
My problem is that I need to use glCallList in each view. But the function glCallList creates an error when it is called from another class than CMainFrame. Do you have any idea of what's happening ?
Thanks.
Jean Bédard
Optifor Inc.
Québec, Canada
|
|
|
|
|
I would like to give more details:
The list is created in CMainFrame like that:
// Delete previous list
BuildList(){
::glDeleteLists(1, 1);
// Create new list
::glNewList(1,GL_COMPILE);
...
::glEndList();
}
Then, each view call BuildList() after setting the display context. The first view that create and display the list is working fine. But each subsequent view produce the following behavior:
-when calling glCallList(1), the error code 1281 is return.
Also, when calling glIsList(1), I get a "false" value.
Obviously, the display list does not exist after the first call to glCallList(1)
Thanks for your support!
Jean Bédard
Optifor Inc.
Québec,Canada
|
|
|
|
|
Since you have multiple views I am assuming you have multiple OpenGL rendering contexts. A display list is only valid in the context they are defined. First you have to have an active context in order to create and use them, and you can not use a display list, created while another context was active(current).
But nothing is without its solution, take look at wglShareLists in MSDN or better your favorite GL book.
Examining your code more deeply...
Create display list names with glGenLists, do not give your own name (eg. 1).
Your problem is, you give the same name (1) for all your display lists for all the contexts, and I think you end up with only 1 display list which is valid under the last context you created, you delete the other ones. So when you glCallList(1) with another context active you get GL_INVALID_VALUE(1281).
PS: if you are comfortable with linking with glu32.lib, you can use gluErrorString to make your error descriptions more understandable.
Orhun Birsoy
|
|
|
|
|
I am trying to set a bitmap on a button dragged from the toolbox. I checked its bitmap property. I do:
if(m_but1.GetSafeHwnd())
{
m_but1.SendMessage( BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)(HANDLE)hicNewIcon);
}
where
hicNewIcon = theApp.LoadIcon(IDI_ICON1);
Initially my button comes up with no windowText. A button click on another button is supposed to show the bitmap on my button. SOmewhere I am doing something wrong....
Thanks,
ns
|
|
|
|
|
|
Nope. Its a member of the class.
Thanks for helping.
ns
|
|
|
|
|
hi:
I have some dialog application which are in dll,and now I want to call these dialogs in an another dialog(I named it as dlgMain ).I want to switch them by clicking buttons in the dlgMain just like we switch propertypages by clicking tab.
thank you.
code is best.;P
Happy Gemini
|
|
|
|
|
Which #include "??" need for
::QueueUserWorkItem ( WorkItemFunc, param,0);
Winbase.h; include Windows.h. - not works.
does such asyncro items are executed in other thread ?
So, thread context changes,
and all thread dependent methods would make error?
Is there methods with no thread context change ?
Or resoring it for other thread?
Thanks.
|
|
|
|
|
You need to #include <windows.h> , and you need to ensure that you've defined _WIN32_WINNT to be at least 0x0500 . QueueUserWorkItem is only available in Windows 2000 and later.
I suggest you read the MSDN Library section Thread Pooling and Jeffrey Richter's book Programming Applications for Windows.
If you need to keep some context for the operation, you should allocate a block of memory on the heap, and pass a pointer to that block as the Context parameter to the QueueUserWorkItem function.
|
|
|
|