|
I am creating several windows using the Create function within Visual C++(MFC), i plot a graph on one of the windows and need it to be updated regularly, as I am implementing a tooltip feature where the mouse can be moved over a point and then the value of that point is displayed. The problem i am having is refreshing the view when another value is displayed, as it keeps displaying the previous values on top of the graph which also means the graph cannot be viewed easily. Any ideas on solving this problem, I tried using Invalidate and UpdateWindow with no luck
Rishi
|
|
|
|
|
see:
http://www.codeproject.com/script/comments/forums.asp?msg=550923&forumid=1647#xx550923xx
and
http://www.codeproject.com/script/comments/forums.asp?msg=549039&forumid=1647#xx549039xx
now my test result is :
the clean app works, but the clean DLL does not.
a good man
|
|
|
|
|
Hi friends,
anybody knows how to Hide a file or folder programatically? I meant, I need to lock that file/folder with password and invisible also.Even if the windows explorer properties set to show hidden items.
Vikram
|
|
|
|
|
vikrams wrote:
I need to lock that file/folder with password
This (i.e., setting permissions) can only be done with an NTFS volume.
vikrams wrote:
...invisible also.Even if the windows explorer properties set to show hidden items.
Wouldn't this kind of defeat the purpose of Explorer being able to show hidden files? There is no super-hidden attribute.
|
|
|
|
|
Hi.
I was wondering if anyone ever wrote a class that handled a CSV-file.
All data is seperated with a comma.
A single line can look like this:
"1234", "MyName", "MyFirstName", "1970-02-15"
The class needs to parse this data. For example checking what the type of data is. (first numeric, 2&3th text, 4th: VALID date (year-mm-dd))
Date needs to be validated too ofcourse.
Anyone can help?
Greetings
Jens
|
|
|
|
|
I have been reading in a file using the getline function and using a (,) as a delimiter.
I made a string caled name.
string name;
Then I do a getline(fin, name, ',');
I need to put the names in a char array. I thought I was doing that until I needed to use the names and I was getting garbage instead of the names I thought I was putting in the char array.
I was doing this to add them to the array which gives me junk.
Names[i] = stdup(name.c_str())
How can I read in a list of names 3 - 8 characters long and store them in a char arrray?
I can't have an array of strings because of other constraints.
Thanks,
Steven
|
|
|
|
|
Where's the CString problem here?
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
If you can be sure that you have enough space in your Names[i] field, then do
strcpy(Names[i], name.c_str()); instead of
Names[i] = strdup(name.c_str()); I seem to remember that your Names definition was an array of char s, in which case this would work.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
I seem to remember that your Names definition was an array of chars, in which case this would work.
Hmmm, I think it was an array of 45 char pointers, which made little sense since (!) the numeric members of that structure were NOT arrays.
Edit: Looks like we were both right. In one post he had
struct TSimHeader
{
char Name[45];
...
}
and in another he had
struct TSimHeader
{
char *Name[45];
...
}
|
|
|
|
|
You have a good memoy,
But if you rememeber, I have to actually put the chars in the array and not just the pointers because the array is getting sent to another PC. The recieving PC would have no use for the pointers on my machine.
here is my structure.
struct TSimSignal<br />
{<br />
int SimWriteFlag;<br />
int DisplayReadFlag;<br />
double Value[45]; <br />
double TimeStamp;<br />
<br />
}static TSimSignal_arr[1];<br />
<br />
<br />
struct TSimHeader<br />
{<br />
char Name[45];<br />
char Unit[45];<br />
double Min[45]; <br />
double Max[45]; <br />
int SignalCount; <br />
int SimStatus;<br />
<br />
}static TSimHeader_arr[1];
Once again back to putting junk in the char arrays (Name and Unit)
thanks,
steven
|
|
|
|
|
TSimHeader header;
strcpy(header.Name, name.c_str()); Should do the trick. If you're sending an array of TSimHeader 's then you'll have something like this:
TSimHeader headers[10];
strcpy(header[0].Name, name.c_str()); Similarly for other members of the array.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan,
When I use the strcpy() function I get the error:
D:\.......cpp(105) : error C2664: 'strcpy' : cannot convert parameter 1 from 'char' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
The array that I am trying to put the ;name in is a char[].
Any Ideas?
Stevne
|
|
|
|
|
Post the definition of Names . That will help
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I posted them in a reply above this one.
Thanks Ryan,
Steven
|
|
|
|
|
Question 1.
I am not able to set CLIENT_EDGE for the dialog programmatically.
I used modifyEx() to set the style. But this did not work. Can any one tell how to go abt to get this done.
Qusestion 2.
I have written a DLL, in which a variable of type CString is set to some value. Setting the value for the variable is through an exe. This exe also displays the value of the string.
Can i display the value of the variable in the second instance of the exe i,e i have an exe by name Display.exe, i will run this Display.exe and set the value for the string. Again i will run another Dispaly.exe(Now i will have two similar exe on my desktop.) through which i want to display the contents of the string. I should use thread for this.
Srinath
|
|
|
|
|
I`m creating an application which uses MSAccess. The application is written and with VC 6.0/SP5 and DAO-SDK 3.6.
When creating the database with MSAccess 95 everything works fine.
When creating the database with MSAccess2K I get the message that this is not a valid database. I also get this message, when I convert the working '95 database to 2K.
I assume, that I have to alter the header files or the alike (and recompile the whole library), to get the application working with MSAccess2K.
I remember having read about this elsewhere in the internet, but cannot remember the location.
Can someone help me. Either by telling me, where to find the information, or providing some hints, what to do?
Regards
G. Steudtel
|
|
|
|
|
Use the following line before using any database routines:
AfxGetModuleState()->m_dwVersion = 0x601;
Once this is called, you should be able to open a MSAccess 2000 version database.
Joel Lucsy
|
|
|
|
|
Hello all
I'm developing an application which uses serial port. I want to code this application in such a way that if any other application is already using the serial port, I want to stop the other application before my application can proceed.
So I would like to know if there's any way of retrieving info reg processes using serial port. If any one knows how to do it please help me.
Thanks for your time
Hari.
|
|
|
|
|
Since the only way to open a serial port using CreateFile() is in exclusive mode, if another app has the serial port open, you won't be able to open it.
Basically, if the serial port exists but you can't open it, then another app has it open.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello Ryan
Thanks for the reply. Using CreateFile() in exclusive mode we can determine whether serial port is already opened or not, But Is there any way of knowing which process is using that serial port and way of getting handle to that process so that we can terminate that process using ExitProcess().
Thanks for your time.
Hari.
|
|
|
|
|
Wouldn't it be rather rude?, besides, it may be a driver that uses the port. I don't know if it is possible to stop a driver on the fly, but i bet the user wouldn't be amused if her mouse suddenly stopped functioning.
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Like Jan said, users don't like programs that do that. You'd be better off simply displaying a box that tells them to close the program using the serial port and then either continue or exit. If they continue, check again, and keep displaying this box until either they do close the program, or they choose to exit.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello Ryan
thanks for the reply. In my case I've a hotsync manager running in the systray. The only time it uses serial port is while doing hotsync. Assume that the user enabled serial port for this hotsync manager but not using it. So I thought it would be better if I can stop this hotsync momentarily so that my application can use serial port and restart the hotsync once my app is done using serial port.
Thanks
Hari.
|
|
|
|
|
haritadala wrote:
So I thought it would be better if I can stop this hotsync momentarily so that my application can use serial port and restart the hotsync once my app is done using serial port.
You could do, but I wouldn't recommend it. Some users would like a program to do this, but almost all wouldn't. Most user's prefer to have control over what is done on their computer.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
, My manager want's me to put this feature in the application I'm developing. Somehow I need to put this feature.
Anyway thanks for your time for answering my questions.
Hari.
|
|
|
|