|
I have syntax color problem.
Can i use two different color for user define data types.
--------------------------------------------------
Say Whatever You Know.
Helping other people is good for health.
=========
Manish
=========
---------------------------------------------------
|
|
|
|
|
if I want the user to input a integer, how can I check to make sure they don't enter a letter, and then if they do enter a letter, to be able to ask that question again?
|
|
|
|
|
Check the 'number' box for your edit box in the dialog template. You *can* also use DDX, where you set the variable associated with the dialog to an int, and specify a range, but I prefer to catch changes in the edit box and handle it myself, as the default method is too obtrusive and annoying.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
I agree with Christian, catching these yourself can be much neater and you can then handle the input error in a way that doesn't inhibit the flow of the user.
If your an operater typing 10 million numbers in a day you don't want a windows messagebox every time you press a wrong key, but you don't want to be allowed to type on if you have entered 'obviously' invalid data.
It depends on whether you only respond to a whole entry (by responding to the enter key) or partial entries (each change in the data entry), as to which windows message you respond to.
On a key by key basis you may check OnChange(), I'm assuming an editbox here.
OnChange()
{
//receive the string as its default type (string)
//use which ever convertion function your data needs
//or simply scan the string to ensure only your required range
//is included.
//on error, beep or move the user to the error -- basically whatever
//your program/user situation requires.
}
I use the beep/move back to error often because I find it is what data entry people want. Put your error checking in a seperate thread and the faster users can work uninhibited until an error.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
Anyone have any ideas how to convert the date such as
January 1st is 1, january 23 is 23 etc. And this must go back the other way. Any ideas would help.
|
|
|
|
|
Just grab the number ? Or do you mean Feb 1 = 32 ?
Is this your homework ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Christian Graus wrote:
Is this your homework ?
Now, that's almost an automatic question to such posts eh?
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Christian Graus wrote:
Is this your homework ?
Nish [BusterBoy] wrote:
Now, that's almost an automatic question to such posts eh?
Whenever someone asks for something that's really easy and seems like it might be divorced from the real world, yeah. I don't mind if people ask homework questions, except when they ask for a pat solution. In this case I wasn't sure if it was homework or if so, if the person was asking for a complete solution ( which is bad ), or was stuck on one bit ( which is fine ). I had envisaged a homework question where you parse the month name to add a number of days and then add the number of days into that month, or get the values out of an array. It seemed a likely homework question.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Convert the date to COleDateTime , and you can get the day number with the COleDateTime::GetDayOfYear() function.
|
|
|
|
|
Hello,
I'm very new to using dc and CBrush.. Basicly I have the following code in my app to custom draw the header of my list control.. I have every thing working except for that I want to change the "COLOR_3DFACE" to a RGB color. How would I go about doing this?
dc.FillRect(rcLabel, &CBrush(::GetSysColor(COLOR_3DFACE)));
Thanks,
Rob
|
|
|
|
|
FillSolidRect allows you to specify a color directly. A color is a DWORD is stored generally using COLORREF, which again is a typedef for DWORD. To declare a COLORREF use RGB, as in COLORREF c = RGB(255,0,255);
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Hello,
I would like to use wildcards with the DeleteFile() function, but I've been unsuccessful so far when using the '*' character. Does anyone know of a better function to use?
Better yet, does anyone know how to use a RemoveDirectory() function that doesn't require the directory be empty first?
-Pete
|
|
|
|
|
|
Hi !
I wan't to develop a test app to add shapes to a CScrollView on mouse clicks.
I created a base class CShape and derived CSquare, CCircle ...
classes.
each class has a .Draw method.
To store objects, I created a class
class CShapeList : public CList<cshape, cshape="">
with a .Draw method that iterates through items and calls .Draw for each object.
The problem is that the method invoked is always the base class CShape .Draw
HELLLLLP !
|
|
|
|
|
You need to make your function virtual. To do this, add the keyword 'virtual' in front of it's declaration in the class's header file.
You might wanna read up on this 'cause it's a rather important part of C++ .
--
Andrew.
|
|
|
|
|
Same way there is code to download a file via ftp or http service, is it possible to download results from a form?
An example, I can make this with my code
.....
AfxParseURL("ftp://tgftp.nws.noaa.gov", dwServiceType, strServerName, strObject, nPort);
if((dwServiceType==INTERNET_SERVICE_FTP)&&!strServerName.IsEmpty())
{
try
{
pConn = m_pInetSession->GetFtpConnection(strServerName, "", "", nPort, FALSE);
etc.........
But, what about if the page addres I want is someting like this (the result of a form)?:
"http://weather.uwyo.edu/cgi-bin/sounding?region=europe&TYPE=TEXT%3ALIST&YEAR=2001&MONTH=11&FROM=1212&TO=1212&STNM=08430"
Thank you.
|
|
|
|
|
You can display the Form using the CHtmlView Class, when you have the form you can analize the html.
But I don't understand what you need...
The form will show you some results? and you want to download the results?
Please explain....
Best Regrads!!!
Chau!!!
Carlos Antollini.
|
|
|
|
|
Well, the results are meteorological data I want to process and make a graph with them.
|
|
|
|
|
Okay luis, hablemso en español.
Lo que podes hacer son dos cosas o biien modificar tu ASP para que te deje archivos con los datos que deseas obtener. la otra es usar la clase CHTMLView. editar la pagina, en el evento onnavigatecomplete analizarla y asi obtener los datos que desas, pero eso puede ser muy complicado, yo sierta vez lo hice, y bueno si te sirve te puedo enviar el ejemplo de como analizaba el contenido de la pagina.
Saludos.
CARLOS....
I also speak spanish. Hasta Luego!!!
Bob is saying his first words in spanish!!!!
Carlos Antollini.
|
|
|
|
|
the below declarations of a simple function in a regular dll in vc++ successed only in vc++ client program and fails in delphi client program.
1. extern "C" __declspec(dllexport) int func(int num)
In Delphi = "access violation at address"
2. extern "C" __declspec(dllexport) int _stdcall func(int num)
In Delphi = Not successed to connect to the dll function at all.
=======================================================================
3.
I saw a declaration of function of dll that created in c and succesed in delphi client program and it seems so:
int far PASCAL _export func(int num)
------------------------------------------
I tried it and I gets warning C4236: nonstandard extension used : '_export' is an obsolete keyword, see documentation for __declspec(dllexport)int far PASCAL _export func(int num)and It not works of course
=======================================================================
What is the sulation ???
|
|
|
|
|
i use:
extern "C"
{
extern int WINAPI myFunc(int param);
}
this works for VB, Delphi, Access, PowerBasic, C/C++, etc..
-c
POKE 808,234
|
|
|
|
|
Manny thanks !
And where is the body of the function ?
|
|
|
|
|
I change my declaration in my dll to that frame:
extern "C" {extern int WINAPI myFunc(int param);
{Body func}
}
Now How have I declare that func in my client program in vc++ for example ??
|
|
|
|
|
Please, help someone ...
==============
www.design.kg
|
|
|
|
|
Can you to be more clever Please...
Best Regards...
Carlos Antollini.
|
|
|
|