|
i have tried to have the argc and argv to be specified as in the main. but the program fails to read the input of the value passed through the command line. i have tried to include a #ifdef _WIN32 and the wmain(int argc, char **argv) and it generated an error of not using WIN16.
i am totally blurr....
calvin
|
|
|
|
|
Is this in an MFC application?
In the InitInstance funtion there is some command line processing
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
If you want access to the args then use the the __argv or __targv
Happy programming!!
|
|
|
|
|
yup i have tried out the code but that is still an error about '/D_AFXDLL'.
i am trying to configure a program to accept the command line input.
but instead of that happening it is going straight into the program and running it.
|
|
|
|
|
I'm not sure what you want to achieve.
The ProcessShellCommand will make the framework do a file new or open a file with the registered extension for your application. If you want to prevent this from happening you can remove that part, or process your arguments before that and the bypass it depending on the results.
If the InitInstance function returns 'FALSE' the application will abort. If you do that then please remember to be kind to the user and let them know why by popping up a message.
Happy programming!!
|
|
|
|
|
My code crashes at:
long valSize = strlen((char *) (_bstr_t) m_pRecordset->Fields->GetItem (key)->Value);
The value is a string like "red" etc.
The double cast seems to be necessary, though
" A _bstr_t wraps a BSTR and a char *."
Any ways, strlen isnt the way to go. SO how can I figure out its size so I can allocate a pointer big enough to hold it?
Thanks,
ns
.
|
|
|
|
|
What type does the Value part return? If it's a _bstr_t just do
pRecordset->Fields->GetItem (key)->Value.length() to get the length of the string (that's in characters, not counting the terminating 0).
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
nss wrote:
m_pRecordset->Fields->GetItem (key)->Value
doesn't this call return a _variant_t ?
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
As Mike said, once you've cast to _bstr_t, you've got a length() function.
long valSize = _bstr_t (m_pRecordset->Fields->GetItem (key)->Value).length();
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
|
|
|
|
|
|
|
you know.. you can edit your messages after posting them. you don't have to reply to them...
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
i want to develop a small instant messenger without using the client /server model
============================================================================================
sorry :have to say that i'm begining with visual c++ and winsock more(network programming) comming from delphi
============================================================================================
so people advise me to use the p2p model i just wana know.
1°)
Without a server is it possible ????
2°)
If yes how can you know if your friends are connected if they have a non static "IP"!!!!! ??????????????
3°)
how programming 2 aplications that can communicate without a server with winsocks is it possible ?????
just give an idaer not the project or a tutorial , it's as you can if you can
if you think that you can't , that means that you can : if you understand this there youn can
|
|
|
|
|
smallcoder wrote:
i'm begining with visual c++ and winsock
Although you wanna do p2p it's better to learn the basics and do a client/server version of the messenger first. The stuff you learn will be directly usable in the P2P version.
smallcoder wrote:
Without a server is it possible
Yes. Otherwise how would gnutella work?
Most gnutella clients connect at startup to server which then gives them a list of nodes to connect to. Another method for discovering peers is to send broadcast packets. This will only work on a lan however.
smallcoder wrote:
how programming 2 aplications that can communicate without a server with winsocks
The client/server model is just a paradigm. In a P2P application a client is both client and server (thus you should have a thread to accept() connections) and also a client of other nodes in the p2p network.
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
i explain you my problem!!
i'm in an computer school and i got a project to do!this is my second year!!
so i choose to do a network application !!!
description :
An instant messenger software with some other stuff , like
sending mail using smptp ,sharing mails using pop3 and upload/download possibilty and ftp possibility!!!developed with vc++6.0
If i do all this stuff in one it's because my teatcher oblige me otherwise i would just do tthe instant message only!!
so for all this stuff i decide to use winsocks for instant message,wininet for ftp and upload/download !!!
But my part in this project is coding the instant messenger the rest is for my friend!!!!
the problem is that to put my stufff on the net on witch service will i put my serveur to mange all the client over the web!!! i don't know if some service are free for letting me doing this so that's why i would like to do a p2p !!!!
but if you have another idaer for me i'm ok
|
|
|
|
|
If this is a project for your teacher to see than there is no need to put it on a server on the web. You can run the server on the same machine as the client for testing/demo purposes.
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
ok your right ! so just another question : i want to know how it's possible to perform or code the stufff to permit a client to see that his friends are connected to the net!!!
people tell me that in aol or msm they use your e-mails address to see if your online .....
so imagine that you give the stuff . if i code it like this how will i show it to my teacher?????
it would be impossible!!!
there for, the only solution would be doing it with ip????????directly
|
|
|
|
|
Not at all. They don't check by sending an email to see if you're online. Most people have a dial-up connection so their ip changes. How would it work if it was ip-based?
IMs work by giving each user a GUID. Plz note that AOL and MSM are not P2P but client-server. When u create a buddy the client will tell the server that a particular GUID is a buddy. Only GUIDs are passed, not emails.
Having buddies in a P2P IM system is harder because you don't have a central server to do the book-keeping. The only way i can see it of working in an IP-agnostic manner would be for the IM to send a search message with your friends GUID. Each client at install time creates a GUID using the win32 api. This means that no central server is required as collisions are (nearly) garuanteed to not happen. Using a P2P based IM creates some issues. Y dont u wanna use a central server?
It's only people who wanna share mp3s who need P2P
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
ok !!!
as you you make it more clear for me i understand that that it was better to use a client/server model!!!
but can you be more clear about the GUID and buddy !!!i don't know what it is
So you could just tell me where or how can i get more information obout that!!!!
|
|
|
|
|
give me the bases and i would build you the house
thanks
|
|
|
|
|
GUID = globally unique identifier - used to uniquely identify a connected user.
I suggest going to freshmeat.net and searching for IMs there. You can download the source-code and get an idea. IIRC Codeproject also has source code for IM. I thinks it's for Sonork.
HTH
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
thanks a lot but the buddy
|
|
|
|
|
you say you create a buddy never see this terms maybe because i'm french
|
|
|
|
|
|
They are all Indian fonts in XP.
|
|
|
|
|
Rama Krishna wrote:
They are all Indian fonts in XP
LOL
Do you know how I can filter them out? I am working on a custom font thingie [.NET] but this font problem is annoying me.
These 5 fonts dont render at all [they just show up in some random font and MeasureItem totally fails on them.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|