|
One solution is and STL list container.
Kuphryn
|
|
|
|
|
It depends on what you are after. As I understand it, you'd want a simply menu like:
CHOICES
----------
1. Display
2. Delete
3. Change
4. Add
If the user chose #1, you'd print the current contents of the array using code similar to what you've shown.
If the user chose #2, you'd prompt for the array index to delete. All items in the array after that index would probably need to be moved "up" in the order to fill in the hole.
If the user chose #3, you'd again prompt for: 1) the array index, 2) the part number, and 3) the part number description. The array item at the specified index would then be updated with these new values.
If the user chose #4, you'd prompt for the part number and the part number description. These values would then be assigned to the next available index.
|
|
|
|
|
I'll read up some more on arrays and the STL list container and maybe something will start smokin' up in my attic.
Thanks, Dave
|
|
|
|
|
¿ANYONE?
[It is possible to represent everything in this universe by using 0 and 1]
I was born intelligent
Education ruined me!.
An idea is useless until it has been implemented.
|
|
|
|
|
What kind of settings?
Kuphryn
|
|
|
|
|
as i said in a dialog..
[It is possible to represent everything in this universe by using 0 and 1]
I was born intelligent
Education ruined me!.
An idea is useless until it has been implemented.
|
|
|
|
|
Your question was really quite open-ended, but I'll stir the tea leaves around and assume you are asking about saving the contents of various dialog box controls to a disk file that can later be opened to return that dialog box to it's saved state.
To do this, just create a data struct that has holders for all variables that are required to hold the dialog box data.
do a binary write of that data struct to disk.
Or create a class and serialize it to disk.
I'm going to live forever or die trying!
|
|
|
|
|
I've blown up this project 4 times by adding all sorts of ActiveX components that I thought would allow me to populate a combobox from a remote datasource but nothing worked.
I have currently kluged a solution that is so horrific I shudder whenever I see it.
My workaround is to create an InternetSession, send an HTTP request to a cold fusion page on my webserver that queries the database and the output is sent back to the buffer that is filled by the CHttpFile* read operation.
I then use character parsing to search for the field delimiters and move the parsed strings into the combobox.
UGLY!!!!!!!!!
For the ActiveX controls I dropped into the project I can't even get a compile. I see vague mention of my needing to create a wrapper class and yada yada.
Is there a prebuilt C++ class that I can just include in my project that will allow me to specify the IP address or name of my server, the ODBC DSN, the SQL query and the Combobox ID and have it populate it for me?
I have successfully added a great directory tree and the Victor Image Library into my project and it all works great, but I need to dynamically populate those comboboxes from a remote datasource.
PLEASE HELP!!!!!!!!
I'm going to live forever or die trying!
|
|
|
|
|
Does your database support ODBC?
|
|
|
|
|
The DB is already mapped as a system DSN on the webserver and is working fine with ODBC.
BTW - The server is running NT server 4
|
|
|
|
|
Then you should be able to create a DSN on your application's machine that "points to" the DB on the Web server. I did this once where a SQL database was on one machine and my client application and DSN were on another machine. Worked fine.
|
|
|
|
|
I had no idea that remote connections with ODBC were possible! I am OK with SQL the language, but very weak on the DB admin side and had no idea that you could map a remote DSN using ODBC administrator.
I went through all of the options in my ODBC administrator and nowhere does it ask me about the IP address for the remote server.
Is there a different ODBC admin tool I need to install first?
|
|
|
|
|
Hi,
I've written a small Winampplugin. Now i Want to catch the Keymessages. I've tried to this by editing the Pretranslatemessage function, but it never gets any messages...what to do now`?
Thanks for your help
|
|
|
|
|
I've lost a class!!!
I've got CMyClass.cpp and CMyClass.h included in the project.
I've got CMyClass working in ClassWizard.
BUT I can't find CMyClass in the left pane of the work area, where I usually have all my classes listed in a tree structure.
What can I do?
|
|
|
|
|
Close visual studio and delete the .ncb file and then reopen the workspace.
John
|
|
|
|
|
Easier and faster...
modify your header file and re-save it (add a space and delete it again or something like this)...
this normally does the trick...
Hope this helps...
|
|
|
|
|
Ok, done!
Thanks!
|
|
|
|
|
You are welcome, this is an annoying problem in the VC ide...
|
|
|
|
|
Hi,
Can anyone tell me how to call an ASP page from a VC++ winsock app?
I have the usual stuff in there at the moment:
WSADATA wsadata;
char Mesgback[10];
unsigned int length;
int nCode = WSAStartup(MAKEWORD(1,1), &wsadata);
u_long addy = inet_addr(szServer);
in_addr Address;
memcpy(&Address, &addy, sizeof(u_long));
SOCKET sd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
sockaddr_in sinRemote;
sinRemote.sin_family = AF_INET;
sinRemote.sin_addr.s_addr = addy;
sinRemote.sin_port = htons(portnum);
connect(sd, (sockaddr*)&sinRemote, sizeof(sockaddr_in));
But I need to call an ASP page as would be done via:
Example: http://www.somedomain.com/somepage.asp?req1=x&req2=y&req3=z
Where the asp page would do the normal request("req1") etc and then do some response.write and the client would then read them in.
Any ideas?
Many thanks in Advance.
Eta_Beta_Pi
|
|
|
|
|
One solution is to send a request.
GET /somepage.asp?req1=x&req2=y&req3=z
...
Here is one reference for HTTP protocol.
http://www.faqs.org/rfcs/rfc2616.html
Kuphryn
|
|
|
|
|
Thanks kuphryn,
Where abouts in send is that implemented? Or is it tacked on to the message?
Cheers
Eta_Beta_Pi
|
|
|
|
|
It's not part of the socket interface.
HTTP is a simple communication protocol riding on the back of eg. TCP/IP.
Basically it is just a matter of sending a request, and getting a response and thats it.
So when your socket is connected to eg. 127.0.0.1 port 8080, then you can send the request "GET ..." including all the required headers through your socket. The server will send the response, and if it is HTTP 1.0, it will close the connection again.
"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
|
|
|
|
|
Hi!
I must write a Testprogramm, which use the COM Port to send bits. But I may not send any start bit or stop bit. I want to write this Programm with VC++ 6. Normally for using COM Port is the DCB structur and CreateFile with an Handle. But i can only turn off the Stop bit, Parity ...and not the Startbit. This will be send..or I don't understand this?
Which function I can use for my programm?
Thanks and Sorry about the English
|
|
|
|
|
You mean, the startbit, which be send normally by the COM Port (if I use Handle with CreatFile and SetCommState with an DCB structure) is only datatrash, that will be send before my own "StartBit"?
So, there is no posibility to use an another function to send bits through COM Port?
|
|
|
|
|
Why do you want to disable the startbit ? In fact this bit is used by the serial port to keep synchronisation. It has nothing to do with your own data and won't "affect" your data.
Hope this helps
|
|
|
|