|
That depends on what you mean by 'initialize it to null'.
If you want to initialize the control, do it in the OnInitDialog() handler of your dialog class. You can use CDateTimeCtrl member functions like SetFormat and SetTime to set the format and content of the control, respectively.
If you want to hide the control, and then show it later, you can also do that in the OnInitDialog() handler. Just call the control's member function ShowWindow(SW_HIDE) to hide the control, and then ShowWindow(SW_SHOW) to show it.
Software Zen: delete this;
|
|
|
|
|
i ment that i want that the control to be blank (empty) with no date on it.
can it be done?
|
|
|
|
|
I m Using VC++ 6
I want to make SETUP of my application .
to instal it on client.
How can i do it . any tool ??
thanx
|
|
|
|
|
you can use windows installer, it should be included in visual studio.
Eugi Games
|
|
|
|
|
I guess this will be the July "Which setup program is best" thread....
I use Inno-Setup from http://www.jrsoftware.org/isinfo.php[^]
You will find that IS-Tool http://www.istool.org/[^] is a good script editor if Inno-Setup.
You can start simple and add on as your needs expand. Their support via news-groups is excellent.
Best yet! I'ts free.
The only downside is that if you're going for the Windows Logo, it doesn't create .MSI setups
|
|
|
|
|
Im building an MDI app that retrieves and updated data from/to a database.
for each table i want to have a childwindow.
i open my childwindows with the main menu.
in each childwindow i want to have a grid table (datatable childwindow) that shows the table's data and an Edit button that will open another window (Update childwindow) with textfields for the user to update the data.
my question is - bcuz i want this to be MDI, should i use Doc/View for the ? and if so, should the Update child window should be Dialog or also Doc/View like the datatable childwindow?
any suggestions?
|
|
|
|
|
If you are editing data on a view, and don't edit it directly (such as in an editable database grid), then you should of course use a dialog - see my earlier window. Synchronizing will be more difficult otherwise, you'll have to do lots of unusual stuff to get the modal behaviour you get for free with a dialog.
You should also use Doc/View - you get lots for free as regards application management with it.
|
|
|
|
|
I am trying to add the TextToSpeech control to the MS Developer Studio (VC++ vers 4.0) Dialog Editor control set. I followed the instructions given in a posting referenced by The CP "Threads with MFC" tutorial by Aria Ansari as follows:-
"Downloading the MS speech API (now at ver.5) did not work for me.
Here is what I did to get the TextToSpeech control to appear as a registered activex control
(this is a much smaller download too).
1. Look for the file c:\windows\speech\xvoice.dll.
If you have this file, go to step 3.
2. Download the speech control and run the actcnc.exe program
you'll find this at: http://activex.microsoft.com/activex/controls/agent2/actcnc.exe
3. Register the activex component.
Open a console window (Start->Run->cmd)
cd \windows\speech
regsrv32 xvoice.dll
Hope this helps those"
I actually ran c:\MSDEV\bin\regsrv32 xvoice.dll. The registration all ran very quickly but seemed to be successful. However, I don't know how to get the control to appear in the Dialog Editor -the instructions in the article are:-
"Step 12:
Open the resource view and double click on the Dialog resource ID of your newly created dialog ,in order to open the dialog editer.
from the main menu choose:
Project ->Add to Project->Components and Controls...
Step 13:
Now the "Components and Controls Gallery" should be opened, double click on the Registered ActiveX controls folder. Choose and insert the TextToSpeech class and close the "Components and Controls Gallery".
Version 4 of Developer Studio only seems to have Insert->Components. What SHOULD I be doing in ver4.0 of Developer Studio to get the control added ?
Any help would be appreciated
Doug
|
|
|
|
|
how can i get the last boot time?
any API 's ?
[ there is one -> statistics Server/client switch in net.exe , but i need to do it in my program.]
mind is everything.
|
|
|
|
|
GetTickCount[^]?
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
that is a DWORD and i tried that earlier, that resets when overflows.
any other idea ..like any registry values ?????
or event log???
mind is everything.
|
|
|
|
|
On Windows NT or above, you could query the value of the System\System Up Time performance counter (which gives system up time in seconds) and work backwards from that. See this article [^]for information on reading performance counters
|
|
|
|
|
I need to convert CString value to const char *. I do the same in following way. I also tried with LPCTSTR, still i get same error.
CString filename;
FILE *fptr;
m_fileName.GetWindowText(filename);
int nLen = filename.GetLength();
LPTSTR lpszString = filename.GetBuffer (nLen );
fptr = fopen( lpszString, "r" );
But i get error as
fopen' : cannot convert parameter 1 from 'unsigned short *' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
i need ur help to sole this issue.
|
|
|
|
|
I'm not sure if this will work, but have you tried simply setting the LPTSTR equal to the CString? I think CString has an LPTSTR operator if memory serves...
-Kmaz
|
|
|
|
|
CString is not able to be assigned with LPTSTR,
LPTSTR lpszString = filename;
gives error
error C2440: 'initializing' : cannot convert from 'class CString' to 'unsigned short *' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
|
|
|
|
|
CString has an LPCTSTR operator, so you can pass a CString object to any function that requires a LPCTSTR
fptr = fopen(m_fileName, _T("r")) CString::GetBuffer() returns a LPTSTR, not a LPCTSTR.
LPTSTR is a char*
LPCTSTR is a const char*
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
m_fileName is CEdit type. Also i hv to collect string value from CstringArray like this..
CStringArray* aXMLfiles;
CString filename;
int mlen = aXMLfiles->GetSize();
// write all the XML files
for(j=0;j<mlen;j++)
{
filename="aXMLfiles-">GetAt(j);
LPTCSTR lpszString = filename;
fptr = fopen( lpszString, "r" );
////do something////
}
still i get error.
|
|
|
|
|
You can take away the extra assignment, this is enough:
fopen( filename, "r" );
or this:
fopen( ( LPCTSTR ) filename, "r" );
If not, your problem lies elswhere, and you might want to post some more code.
|
|
|
|
|
still problem continues.I put the code for ur ref.
CStringArray* aXMLfiles;
int mlen,j;
CString filename;
FILE *fptr;
aXMLfiles = GetFileNames("*.XML"); /// This function retrives me all XML files..
mlen = aXMLfiles->GetSize();
for(j=0;j<mlen;j++)
{
="" filename="aXMLfiles-">GetAt(j);
fptr = fopen( ( LPCTSTR ) filename, "r" );
if (fptr != NULL){
// do something }
}
fopen' : cannot convert parameter 1 from 'class CString' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called.
|
|
|
|
|
As CString has a user-defined operator LPCTSTR , the "or the operator cannot be called"-part of the error message seems to be the interesting part. What is the error number (CXXXX) you get?
|
|
|
|
|
Are you using Unicode? The complaint about "unsigned short*" looks like you are trying to feed wide characters to a function that understands only 8-bit chars.
|
|
|
|
|
This is why i stopped using CString.
It's an all or nothing proposition.
If you compile for UNICODE then it wraps an array of wchar_t (unsigned short).
If you compile for ANSI then it wraps an array of char.
You can't cast between the two, you must convert.
Use wcstombs to go from a wchar_t to char.
Use mbstowcs to go from a char to wchar_t.
[EDIT]
Actually what you should do if using CString is go the whole way and use all the _t funtion versions. e.g. _tfopen() will work with a CString regardless of it being UNICODE or ANSI. Most functions that take a char* have a _t*() version. Check the MSDN doc's.
[/EDIT]
...cmk
Save the whales - collect the whole set
|
|
|
|
|
I want to make a dialog popup like a toolbox, but be a resizable dialog with controls i want on it. I've seen it in some other applications and I would like to add it to one of mine. Any links/ideas/suggestions would be appreciated.
-Kmaz
|
|
|
|
|
You want a resizable, modeless dialog. It's not different from a normal dialog, but you select resizable border from the styles in the resource editor, and call Create instead of DoModal . Add a member of the dialog class to the parent class, call Create as soon as possible (after the parent window is created, this depends on the kind of window), and then call ShowWindow to show/hide the toolbox.
|
|
|
|
|
I can't believe i didnt think of that...I'm an idiot
|
|
|
|