|
|
I don't catch your meaning , can you give me a more definite suggestion? Thanx.
|
|
|
|
|
|
Hey everyone! I'm trying to create a utility which allows me to switch network settings on my Windows 2000 system. The purpose of this is to allow me to have two different configurations for my LAN connection - one for at home using a static IP address and a DHCP account for work.
My question is this: how can I programatically access the network settings under Windows 2000? Specifically I need to get and set the TCP/IP settings for a network adapter, and disable/enable it. I'm guessing that the information can be accessed in the registry somewhere within HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet, but there has to be an API that exposes this in a more sane way. Thanks!
|
|
|
|
|
The 'IP Helper API' is what you need ,check the platform SDK
|
|
|
|
|
Thanks Adara, that's exactly what I need!
|
|
|
|
|
It seems that MFC don't allow me to open documents with the same name......
I JUST WANT to have my MDI apps able to *open* and read multiple documents with the same name...i.e. my OnOpenDocument() will be called everytime even if i'm opening another file with the same name... I don't want them to have views sharing the same doc... because at later time I'm going to add different things into all of them.... and maybe have them output data eg. filename.001 for view 1, filename.002 for view 2..... Pls help.
|
|
|
|
|
The code you want to change is located in the CDocManager MFC class; its virtual function OpenDocumentFile checks if document is already open. You'd have to derive CYourDocManager and change the OpenDocumentFile method.
KB article Q198538 has sample which reportedly uses its own CDocManager to provide multiple extensions for one doc type.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Is it possible to catch class A's messages fron within class A?
The problem is I have a class that inherits from WTL's CComboBox and I need to respond to the events in CComboBox before they are sent to the parent control.
I know I could inherit from CWindow and then contain the CComboBox, but I'd like to avoid this i f possible. I've tried using reflection too but no success there.
thx for any help
/Tomas
|
|
|
|
|
What you want can't be done in ATL, sorry. ATL doesn't have a total custom message routing system like MFC. The message gets processed by its target window, and only that window, unless you use a macro such as CHAIN_MSG_MAP or REFLECT_NOTIFICATIONS to re-route it yourself.
--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
|
|
|
|
|
hi all,
how can I select window's "Recording Control" stereo Mix Balace or Mono Mix Balace Programetically.
thanks in advance.
|
|
|
|
|
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
|
|
|
|