|
I'm using a workaround: getting window's font once + catching changes.
|
|
|
|
|
I have "men.x"(<--this word) in Listbox when I double click at "men.x" , the 3D model is loaded to show in frame suddenly so... "men.x"'s type is CString. How can I convert CString to LPSTR? because I have to use D3DLoadMeshFromX(LPSTR pfilename,....)to call file.x
So .... How can I do????
Bug
|
|
|
|
|
Maybe (LPSTR)((LPCSTR)strFilename) works or make a strcpy to a char,
Gero
|
|
|
|
|
Converting CString to LPSTR is easy:
CString csString;
LPSTR lpString;
lpString = csString.LockBuffer();
csString.UnlockBuffer();
-Dominik
|
|
|
|
|
Try this:
CString csString;
LPSTR lpString;
lpString=(LPSTR) csString.GetBuffer(0);
I hope, this will work!
A. Riazi
|
|
|
|
|
How do I control remote program over the network with Visual C++. I mean, for example, I want to move a button from that program to a new location or lock the program or what ever. Thank you very much in deep for your interest...
P.S. Please tell me a correct site if my problem is not related to this site. Thanks...
Phalanx
|
|
|
|
|
Do you know Client/Server architecture? Do you familier with programming sockets?
if so, use CSocket derived class to send data/information from one computer to another. Also its possible to use Named Pipe.
A. Riazi
|
|
|
|
|
How do I control remote program over the network with Visual C++. I mean, for example, I want to move a button from that program to a new location or lock the program or what ever. Thank you very much in deep for your interest...
P.S. Please tell me a correct site if my problem is not related to this site. Thanks...
Phalanx
|
|
|
|
|
|
I have my website located on a remote server, and there is a MDB database on the server. The Server is Win 2000 Advanced Server. I want to make such a software in VC++ that can import data from the remote database and show the filtered records to the client.
Can this thing be made in VC++, if yes then please help me how to make this thing.
Regards
|
|
|
|
|
Are you familier with Client/Server programming? Do you know how programming with sockets?
A. Riazi
|
|
|
|
|
Ya I am familier with Socket Programming.
But the socket can only send and receive message among themselves. How will the socket get the database records to send to the client socket. How will the server socket connect itself to the database.
|
|
|
|
|
Server does not connect to database. Your client must drive and work with your database. Client gets commands from server and returns data (results).
Then server shows data (Database records) in such a list control.
A. Riazi
|
|
|
|
|
OK, Thanks for your reply. Then please tell me how to connect the client socket to the server datbase. Usually we use ODBC or ADO to connect to the database on the PC we give the DSN or direct address of file and connect to it, but how will we connect to the database that is located on the web server. Indeed I can make a DSN pointing to my database on the web server
Regards
|
|
|
|
|
I am trying to create a Windows Service tonight that can be called via ASP and ASP.NET, as a way to store session state between them. Getting the service going in .NET with C++ is proving a nightmare, I create a skeleton and it won't compile, there is no meaningful help, etc.
Can anyone help me ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
Do you want a service in managed c++?
If you just need a service, I have a small skeleton I have used for several services, and I have also compiled it as managed C++...
Do you want a copy?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I'd love a copy, so long as it's callable from classic ASP via COM. I don't need managed C++, the standard C++ one would be better.
Thanks heaps.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
Christian Graus wrote:
so long as it's callable from classic ASP via COM
Woops, I did not think about that, it's not callable via COM
Why don't you make a new ATL Project, then you can select "service" from the wizard.
That's the easiest way to get a service that you can call via COM
Right now my service skeleton only works with Named Pipes as communication to the "outside world", but if you are interested, just ley me know, and I'll send you a copy tomorrow...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Anders Molin wrote:
Why don't you make a new ATL Project, then you can select "service" from the wizard.
That's the easiest way to get a service that you can call via COM
Yeah, but the resultant service does not compile and it seems most of the help on creating C++ services has been removed to make room for the exciting news that I can do it in VB.NET.
Thanks all the same.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
Hi everyone.
I am working on a small program for school project. Apparently the teacher does not want to help so I decided to look for a help on the message board.
I need to write a function that takes seven digits input by user
ex. 123454 store them in the array and after that do some mathematical operations on them such as add, multiply.
Well, I can read them in as characters and tried to converted them into int after inputing to array but did not work.
I tried casting with the same result.
Can anyone suggest what should I do in order to read in as characters and convert them into integers. ( the whole program should resemble calculator that will add two big numbers let say 16 digits.)
Any help would be appreciated.
Here is my code.
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
void main() {
const int ROWS = 6;
char inNum1 [ROWS];
int sum = 0;
int conValue = 0;
cout << " enter your number" ;
for ( int i=0; i <rows; i++="" )="" {
="" cin="">> inNum1[i];
}
cout << "num [0]= " << inNum1[0] << endl;
cout << "num [1]= " << inNum1[1] << endl;
cout << "num [2]= " << inNum1[2] << endl;
for ( int j = 0; j< ROWS; j++ ) {
sum += inNum1[j];
}
cout << "total sum = " << sum << endl;
}
|
|
|
|
|
Read the user's input into a std::string , which will properly null-terminate the char array so that atoi() works.
std::string sInput;
cin >> sInput;
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thank you, I will try this tonight, the pointer looks good.
|
|
|
|
|
The old fashioned trick was to subract ASCII 0 (zero) from the character, e.g.
for ( int j = 0; j< ROWS; j++ ) {<br />
sum += inNum1[j] - '0';<br />
}
You of course need to validate the data, i.e. is it between 0 - 9
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
geralt wrote:
Can anyone suggest what should I do in order to read in as characters and convert them into integers
Why not just:
int foo;
cin >> foo;
On the other hand, the following effectively rules out plain integers:
the whole program should resemble calculator that will add two big numbers let say 16 digits
Perhaps you could use __int64? If not, you better look up a large integer library such as GNU MP or NTL.
|
|
|
|
|
Thank you for advice, I will try this tonight once I come back to my project
|
|
|
|