|
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.
|
|
|
|
|
haritadala wrote:
My manager want's me to put this feature in the application I'm developing.
OK. Sorry, I can't help with it There is a way to do it (there are apps to do it - see Process Explorer from www.sysinternals.com[^]), but I don't know how it's done.
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"
|
|
|
|
|
If you are adding C files to CPP project you may consider adding:
extern "C"
{
}
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
Post some of the errors so we can see what they are (the first and last 5 at least).
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"
|
|
|
|
|
Hi,
My app has a bunch of menu items in which I would like to bring up different windows. One of the windows has an option that when checked and "ok" is hit will bring up another window. This (2nd)window also has its own menu selection that will bring it up.
My problem is that if i display the (2nd) window and then bring up the other (1st) window that allows me to check if i want to see the information and hit "ok", it creates the same exact window. How can I get it to check if there is a window already open and just set focus to it? I am currently using this code:
if (m_pStats== NULL)
{
m_pStats= new CStats;
if (m_pStats->Create(IDD_STATS) == TRUE)
m_pStats->ShowWindow(SW_SHOW);
}
else
m_pStats->SetActiveWindow();
Can someone walk me through this and help me with this. I am extremely new to programming and would like to figure this out ASAP!
THANKS IN ADVANCE!
|
|
|
|
|
hi,
can anybody tell me ,how to use MSDE with MFC applications.
Any help will be highly appreciated.
Thanks and regards.
|
|
|
|
|
That is Microsoft's Data Engine. Which particular database are you interested in working with (e.g., Access, SQL, FoxPro)?
|
|
|
|
|
Connect and access it just as you would SQL Server. The only real difference is the number of concurrent connections it supports, resource usage limits and the fact that it does not come with the SQL tools (EM, Query analyzer, etc.).
onwards and upwards...
|
|
|
|
|
Hi,
I'm quite new to programming in MFC,
Can you tell me how to add a Button (I think CButton-like), to an empty form and add some functionality (an eventahndler)?
|
|
|
|
|
BoudewijnEctor wrote:
Can you tell me how to add a Button (I think CButton-like), to an empty form
Use the resource editor from within the IDE.
BoudewijnEctor wrote:
...and add some functionality (an eventahndler)?
Use ClassWizard.
|
|
|
|
|
XP icons with shadow does not draw properly. I'm using standard functions and can't understand what I do wrong.
|
|
|
|