|
Check the key in the registry at:
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop]
Set this to 0
"ScreenSaveActive"="0"
Or set yourself as the screensaver
"SCRNSAVE.EXE"="logon.scr"
"ScreenSaverIsSecure"="1"
Or Set a really big timeout
"ScreenSaveTimeOut"="6000000"
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
thank you.
i still don't know how to reach the keys. can you give me a hint on how to write the code for doing that?
|
|
|
|
|
Check RegOpenKeyEx Family of API
you can also search CP for classes encapsulating registry access
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
I'm building a dll that is staticaly linked to MFC .
I'm trying to add an ActiveX control to a dialog in the dll.
After adding the ActiveX to the dll dialog I called the dll from an exe file. I always get an error for the create function (I use the following code to launch the dialog)
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CMainDialog *m_MainDialog;
m_MainDialog = new CMainDialog;
m_MainDialog->Create(IDD_DIALOG_MAIN,NULL);
m_MainDialog->ShowWindow(SW_SHOW);
If there is no ActiveX on the dialog this code works fine.
Please help.
Thanks.
avivhal
|
|
|
|
|
You probably forgot to put AfxEnableControlContainer into your DLLs InitInstance...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
I was writing some code to export some data to an Excel chart.
Here's a snippet of the code that is intended to add Sheets to a workbook .
From my apps point of view everything is ok , But when I exit or leave Excel without saving this file I get a MessageBox with a Memory Error . I was wondering if u'd have some suggestions . I am including "excel8.h" in my code. Thanks
COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
_Application app;
Workbooks books;
_Workbook book;
Worksheets sheets;
_Worksheet sheet;
Range range;
Font font;
Range cols;
CStatusDialog statusDialog;
Interior interior;
int sheetIndex = 0 ;
int cycleStepCount=0;
string data;
char *p;
char c[20];
statusDialog.Create(IDD_DIALOG6,(CWnd*)this);
statusDialog.ShowWindow(SW_SHOW);
statusDialog.CenterWindow();
if(cyclePt.cycleCount){
// Start Excel and get Application object.
if(!app.CreateDispatch("Excel.Application")) {
AfxMessageBox("Couldn't start Excel and get Application object.");
statusDialog.ShowWindow(SW_HIDE);
return;
}
//Get a new workbook.
books = app.GetWorkbooks();
book = books.Add(covOptional);
//Get the first sheet.
sheets =book.GetSheets();
int ct=0;
if(cyclePt.cycleCount<=3)
ct =0;
else
ct = cyclePt.cycleCount-3;
// Excel Does seem to crash when I do this
if(ct)
sheets.Add(covOptional,covOptional,COleVariant((long)ct),covOptional);
app.SetVisible(TRUE);
app.SetUserControl(TRUE);
return ;
|
|
|
|
|
During loading HTML page into HTMLDocument (IHTMLDocument2.write method), how could be launching of scripts in that page prevented?
|
|
|
|
|
I am using MFC (the CDatabase and CRecordset classes) to query a database which has some simple Chinese text stored. My code is built in unicode mode and everything works fine, except that all the chinese characters got converted to the ? character (ascii code 63).
This does not have anything to do with the database because I tried another .NET program with no problem (I was able to get chinese characters from the database). Any help is appreciated. Thanks.
My articles and software tools
|
|
|
|
|
The '?' implies that the Chinese character can't be mapped into the existing encoding (which defaults to Windows-1252). To properly support Unicode data, you should store your data in CString objects (which are UTF-16), or in UTF-8 char* strings. If you choose the latter, you'll need to explicitly transcode() the string using the correct target encoding (i.e. UTF-8).
FYI, I've found a bug in the default (no args) version of the Xerces (C++) transcode() method, which fails silently when it encounters a char that can't be mapped. Instead of replacing an unmapped char with '?' , the method inserts a '\0' , effectively truncating the returned string.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thanks for the info.
I traced into my source code, when I call the CRecordset::GetFieldValue method, a database field is supposed to be read into a CString variable. I checked the actual value, it is already 63s (question marks). That means something happened between the database and the MFC dll which converted the text into question marks.
I am 100% sure that I am building and debugging unicode version of my program.
My articles and software tools
|
|
|
|
|
I use the Classes by Carlos Antolini (ADO)
and have no problem storing and reading cyrilic
unicode strings.
|
|
|
|
|
|
Xiangyang Liu wrote:
That means something happened between the database and the MFC dll which converted the text into question marks.
Yes, or perhaps the app that loaded the database from a Unicode source performed an invalid transcode and stored question marks into the db? I recommend querying the db outside your app to find the culprit.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
It turns out the MFC dll (6.0) does not support ODBC unicode data. The unicode string types SQL_C_WCHAR and SQL_C_WVARCHAR cannot be found from the source code.
The ODBC drivers I used may not support unicode either (version 3.5 or higher is required).
I will have to use ADO or .NET.
My articles and software tools
|
|
|
|
|
|
When you see ? it means a Unicode->ANSI conversion was done, but your current ANSI code page did not contain equivalent characters. WideCharToMultiByte() is the underlying API, and it inserts ? for unconvertible characters.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Four fonts walk into a bar. The bartender says "Hey - get out! We don't want your type in here."
|
|
|
|
|
Thanks, Mike. I read your article about testing unicode programs, it is very helpful.
I suspect this specific problem is in the ODBC driver, it may not support unicode properly or it is misconfigured. I will keep looking tomorrow.
My articles and software tools
|
|
|
|
|
It turns out the MFC dll (6.0) does not support ODBC unicode data. The unicode string types SQL_C_WCHAR and SQL_C_WVARCHAR cannot be found from the source code.
The ODBC drivers I used may not support unicode either (version 3.5 or higher is required).
I will have to use ADO or .NET.
My articles and software tools
|
|
|
|
|
Use the ADO if possible.
We converted from using ODBC to the ADO and it works fine for us - Japanese, Chinese, German, French, Spanish, and English. There may be other languages in use I am not aware, like Russian (Cyrillic text).
Also, I found that the ADO access to the database was much quicker.
|
|
|
|
|
I am trying to Write a Desktop application. I have used alot of char based Program compliers such as Basic, C, Fortran, Pascal, Cobol, Etc...
I am haveing a real tough time understanding the C++ Visual Layout and how it operated with Just writing the code...
Lots of screens and not much information on how or what.
Is there A training Module or is there a step through tutorial. Or maybe even someone that can step me through the basic operation.. Im sure once i grasp the concept and get the Rudementary questions answered I will be off and running...
I am working on a project that reequres me to use this and i need to complete this as quickly with out the cost of cutting corners to complete this project.
Thank you very much.
Rilliams
Rilliams2@cs.com
|
|
|
|
|
Download The PDF[^]
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
I have to create an application to manage the appointments, I have to insert, modify, move, delete any appointment.
Where I can find (or buy) a control like the calendar in outlook 2003?
|
|
|
|
|
www.bcgsoft.com does exactly what you want (and more), but it's unfortunatly not free anymore
There is no spoon.
|
|
|
|
|
I would like an MFC code instead then an ocx.
I would like to show it as outlook 2003 in a view.
By means of the MFC wizard intercept the message.
|
|
|
|
|
BCG library is 100% MFC code for MFC applications.
There is no spoon.
|
|
|
|