|
How to enable/disable a menu item in a pop-up sub-menu? For instance, I'd like the "File->Save" to be grayed out, before "File->Open" is choosen.
Very appreciate for any help from anyone!!!;P
ouliatgreatstatus
|
|
|
|
|
Are you using MFC? In that case, you add a command enabler to the command. There, you call Enable on the input parameter CCmdUI .
You'll also want to add a flag in some appropriate place for the prerequisite, of course.
|
|
|
|
|
When I create a Monochrome bitmap, select it into the CDC*, and draw on it, I get the expected monochrome results (ie. balck and white pattern fills for pDC->Rectanlge(&rc)).
However, when I attempt to create a 16 color bitmap (4-bits), and try the same drawing code, nothing appears in the client area.
This is what I am using for Monochrome drawing:
bmpBitmap.CreateBitmap(rc.Width() ,rc.Hieght(), 1,1, NULL);
This is what I am using for 4-bit drawing:
bmpBitmap.CreateBitmap(bm.bmWidth , bm.bmHeight, 1,4, NULL); //4th Parameter is nBitcount
The drawing code that works for the MonoChrome (and stock CDC bitmap) works fine, but nothing appears for the 4-bit Bitmap. What am I missing?
Thanks for any information you can provide,
Joe
|
|
|
|
|
I'm trying to find some sample code to print the dialog with the content in it.
Thanks a lot in advance!
ouliatgreatstatus
|
|
|
|
|
|
We have a service that runs on NT, 2K and some XP machines (without SP1). Does anyone have any idea what would cause the service to not run on certain XP machines (XP with SP1)?
Thanks!
DB
|
|
|
|
|
<sarcasm>It could be that something ( we have no way of knowing since you didn't give us any idea what the service does or how it does it ) in your service is incompatible with something in Windows XP SP1.</sarcasm>
Perhaps this will help you http://www.winsupersite.com/reviews/windowsxp_sp1_preview.asp[^]
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
What do you mean does not run, a crash, hang? What are the symptoms?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
When start from the SCM get this error:
Could not start the 'service name' service on Local Computer.
Error 1053: The service did not respond to the start or control request in a timely fashion.
|
|
|
|
|
I want to read content of external file with my VC++ program. any idea? appriciate any help
really thank you
|
|
|
|
|
|
I am using Visual C++ 6. All I want is to create a subclass to an existing class in the "Class View" window. How is this done?
|
|
|
|
|
class MySubclass : public MyExistingClass
{
.... implementation goes here
};
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I thank you for that. In the Microsoft Visual C++ editor, is there a way to have the program assist you in making a subclass so that it appears nested under its base class in the "Class View" window?
|
|
|
|
|
ZeroGs wrote:
so that it appears nested under its base class in the "Class View" window
No. VC6 IDE Class View does not display class relationships. Use the Class Browser to view that. Select the Class Name using the cursor in a code window of the base class and the execute the Browser command "Derived Classes and Members"
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
hi,
i have a server-client chat!
i want to encrypt the messages what i send from server to client or from client to server...
and i want to use SSL!
can anybody help me to encrpyt a message like "hello" with SSL
and to decrypt! i saw that i must use a lot of libs for SSL...not so easy!
best greets,
surf
|
|
|
|
|
I am using IsPVoice in an application where I would like to be able to cancel some speech after it has been paused. I currently use Resume() followed by Skip(). Unfortunatly, this still allows a word or two to be spoken before it completes. I have tried setting the volume to 0, as well as setting the tempo to -10 prior to Resume(). I have also tried emptying the event queue before resuming. None of these has worked.
|
|
|
|
|
I need to be able to write files directly to a CD-RW disk,
however, the way things work in XP is to keep a cache on
the local disk, and then actually write them on user command.
I need to bypass this mechanism and write directly to CD,
or at the very least find some mechanism to start the "copy
from cache to the CD" system.
Does anyone have any suggestions for me?
Thanks, in advance.
|
|
|
|
|
Hello,
nde_plume wrote:
find some mechanism to start the "copy
from cache to the CD" system
For this problem use the ICDBurn Interface or IMAPI ... With this interface you can start the default burn mechanism (Dialog) or directly burn files but only under Windows XP (look at MSDN)...
They exists some wrappers in the web...
When you need a solution for all windows systems then you must use a comercial library (from nero or roxio)... In my mind, an other alternative dosen't exist because cd burning needs much knowledge about IDE and SCSI...
good look and cu...
|
|
|
|
|
Hi
I use this code to test CEvent MFC Class :
(Win32 Console App with MFC support)
#include "stdafx.h"
#include "TryEvent.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include <afxmt.h>
CWinApp theApp;
CEvent ev(TRUE,TRUE);
using namespace std;
UINT Start(void* data)
{
int n=ev.Lock();
cout <<"Inside Thread\n";
return 0;
}
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
CEvent ev;
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}
else
{
CString strHello;
strHello.LoadString(IDS_HELLO);
cout << (LPCTSTR)strHello << endl;
}
int n=ev.ResetEvent();
AfxBeginThread(Start,NULL,0);
cout <<"Before Thread\n";
Sleep(5000);
n=ev.SetEvent();
Sleep(5000);
cout <<"The End\n";
return nRetCode;
}
the expected result should be that the "Before Thread" apperas then the "Inside Thread" after 5 seconds..
but it seems that the secondry thread does not wait for the SetEvent
I read this sample :http://simplesamples.info/MFC/Events.php[^]but no good
any help ?
|
|
|
|
|
You are still thinking in "sequential" mode. Once AfxBeginThread() has been called, the thread is created and running (unless CREATE_SUSPENDED was used) independently of the primary thread. Relying/depending on either thread to be at a certain spot at a certain time is a recipe for disaster.
Read this entire thread. It has some interesting and pertinent information on how two threads interact (e.g., timing). Here is another.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have never used CEvent but here is what I think you are trying to do
class EventPOC
{
public:
static void poc()
{
DWORD threadID = 0L;
HANDLE hEvent = ::CreateEvent( NULL, TRUE, FALSE, NULL);
cout << "Starting thread" << endl;
HANDLE hThread = ::CreateThread( NULL, 0L, (LPTHREAD_START_ROUTINE)threadFunc, (LPVOID)hEvent, 0L, &threadID);
::Sleep( 5000);
::SetEvent( hEvent);
::WaitForSingleObject( hThread, INFINITE);
cout << "Thread exited" << endl;
::CloseHandle( hEvent);
}
static long WINAPI threadFunc( void* param)
{
HANDLE hEvent = (HANDLE)param;
::WaitForSingleObject( hEvent, INFINITE);
cout << "Inside thread" << endl;
return 0L;
}
};
Of course you would execute the proof of concept by putting this in your main function
EventPOC::poc();
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
thank you all for help
that problem was that i have CEvent ev; inside _tmain ..
What a mistake..
sorry for wasting your time
|
|
|
|
|
Hi,
Is it possible to intercept file input and outputs?
Let's say I have a server and on that server I have my own forum controlled by my application ( someone connects to it and my application opens a file and put a value in it, the "someone" want to read a value somewhere then my application read a value). Well I want to write another application which will signal me when a change is made in the mdb file (or other types its not important) and which values were inserted or retrieven?
Thank you very much in advance for your answers!
Well... I am a beginner ...
|
|
|
|
|
Scolinks wrote:
Is it possible to intercept file input and outputs?
Yes, but it requires a device driver that watches for all IRPs and FastIO requests. Obviously this is no small undertaking.
Scolinks wrote:
Well I want to write another application which will signal me when a change is made...
This sounds like you simply need to use ReadDirectoryChangesW() and/or FindFirstChangeNotification() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|