|
Hey thanks everyone who replied.
|
|
|
|
|
My service is based on MFC Dialog. I can show a system tray icon when I login. But I find a strange problem. When I logoff then re-login. The service works great. But if I logoff again, win2000 will not logoff? The problem comes from my interactive service. Because if I close it, win2000 works normaly.
Any NT service expert help me ?
|
|
|
|
|
Is it possible that your service refuse to shut down?
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
|
|
|
|
|
Hello,
I am new to ths so please be kind.
I am using C++ and I want to Parse a XML message and change some data and then submit it to the next process. I think a DOM parser is what I need.
I am using VC++ .NET.
Can someone please give a snipt of code of how to do this? What I am doing must be wrong becuase I do not get any attributes or elements from the message.
Here is what I was trying to do.
memset(ls_message, 0x00, sizeof( ls_message ) );
BuildMessage(ls_messagestruct, ls_message);
XmlDocument* mydoc = new XmlDocument();
strcpy(buffer, ls_message );
mydoc->LoadXml(buffer);
XmlNode* root = mydoc->DocumentElement;
XmlNodeList* xnl = mydoc->ChildNodes;
XmlAttributeCollection* attributes = mydoc->DocumentElement->Attributes;
IEnumerator* ie2 = attributes->GetEnumerator();
IEnumerator* ie = xnl->GetEnumerator();
while ( ie2->MoveNext() == true )
{
Console::WriteLine("Attribute:{0} Value {1}", (dynamic_cast<xmlattribute*>(ie2->Current))->Name,(dynamic_cast<xmlattribute*>(ie2->Current))->Value );
}
while ( ie->MoveNext() == true )
Console::WriteLine("Child: {0}", (dynamic_cast<xmlnode*>(ie->Current))->Name);
while ( ie->MoveNext() == true )
{
XmlNode* pNode = dynamic_cast<xmlnode*>(ie->Current);
if( pNode->NodeType == XmlNodeType::Element )
{
Console::WriteLine(" Found The root ");
//processRoot(pNode);
XmlTextWriter* xtw = new XmlTextWriter(Console::Out);
xtw->Formatting = Formatting::Indented;
mydoc->WriteTo(xtw);
xtw->Flush();
Console::WriteLine();
}
else
{
Console::WriteLine(" Root Was not Found ");
}
}
Thanks for the help
|
|
|
|
|
Isn't there a function that you can call to set the color of a particular control?
I'm guessing not, so is there an easy way I can set the color for an edit box back ground? If I have to owner draw this does anyone have a class that I can subclass this to?
Thanks again!
|
|
|
|
|
|
will we get to see the source code?
|
|
|
|
|
|
I took a look at the HTTP example on codeproject that explains the GET and POST command:
http://www.codeproject.com/internet/HTTPGet-Post.asp
Now, i thought i understood perfectly well what was going on, when you type in a url in your browser it connects via tcp to that server and sends a header to that server to retrieve a page.
Now there's this site http://www.proximus-interactive.be of our mobile operator, just a commercial site like any other. But spooky enough, i wrote an application that tries to connect to port 80 on www.proximus-interactive.be and it wont connect!! but when i surf there in my browser it works fine... doesn't that mean my browser connects to it..on port 80? cause its the default.. and i noticed other sites do the same thing, and its really bugging me. If anyone knows whats causing this please explain.
Thank you very much in advance.
P.S.: i can connect to a bunch of other sites just fine, so its not me :p
Kuniva
--------------------------------------------
|
|
|
|
|
See if you can connect using Chris' WebGrab[^] sample. It's possible that the server may be refusing your connection based on the agent name.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi, The webgrab sample you directed me to used the CInternetSession class to do all the connection things itself, there is no code in the Webgrab sample that actually shows the connection being made, it just uses functions from CInternetSession. And the Agent cannot be the problem because i simply cant connect to the server, i cant even send the agent!
But now i was thinking, i use a proxy server, maybe it has something to with that? maybe do i just need to connect to my proxy and post the request there??? or how does that work??
Thank you for your reply and help.
Kuniva
--------------------------------------------
|
|
|
|
|
eh its probably not the proxy either because i can connect to other servers fine... god this is annoying :-s
Kuniva
--------------------------------------------
|
|
|
|
|
I tried this from the command prompt
telnet www.proximus-interactive.be 80
GET / HTTP/1.1
Host: blah
and it goes into some weird character mode. I've never seen that either.
Todd Smith
|
|
|
|
|
you can connect to it through telnet???
i cant even do that!! lol
Kuniva
--------------------------------------------
|
|
|
|
|
I'm using Visual C++.NET to do some low level stuff - direct file access, etc. - that I can't do in Visual C#.NET but forms and controls are very tedious hard labor at that level. Is there a way I could use the visual aspects of C#.NET to draw forms and controls and then use them in visual C++.NET?
|
|
|
|
|
I don't see why not, provided you create a managed application that produces a winexe. I've not done it myself, but this language interoperability is something MS has been really pushing.
Of course, you can always do it the other way round also. You ought to be able to create an assembly which wraps unmanaged code and then use this assembly from a C# project, thus create the UI etc. in C# which uses types exposed in the C++.NET assembly.
Again, I've not done it but it would probably be better to produce a UI application in C# that uses a C++ assembly, as opposed to a C++ application which uses a C# assembly to display forms etc. You can probably do it both ways, but the latter is probably less of a head trip
If you need more help let me know and I'll fire up my VS.NET and give it a try.
--
Paul
"I need the secure packaging of Jockeys. My boys need a house!"
- Kramer, in "The Chinese Woman" episode of Seinfeld
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
Apparently you can debug the release version of the project just like the debug version if you add symbols. How to do this?
Thanks,
ns
|
|
|
|
|
In VC6 go to Project Settings, in C/C++ page select Debug Info: Program Database and in Link page check Generate debug info.
Sonork 100.15206;PavelK
|
|
|
|
|
Okay Thanks.
Another problem....I have the debug version going and when I run it to the breakpoint it brings up a dialog asking where the pdb file is.....mfc42.pdb....
Whats this? It never did this before....
|
|
|
|
|
I've never encountered this. The pdb files (program database) contain debug informations for programs and libraries. By me is the mfc42.pdb file is installed in system directory WinNT\System32.
Sonork 100.15206;PavelK
|
|
|
|
|
Something's wrong if your debug version is linking with mfc42.dll. It should be using mfc42d.dll, so check your linker settings.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I'm working on a small database as an exercise to give to my friends and family. This is just to help me learn a little database programming and thought it would help me learn more to add extra functionality to the form.
I've tried and can't figure out how to color the form. I'd like to add a set of buttons (which I've done) that will allow the user to pick the color of the form background.
I'd appreciate any guidence on this.
Thanks
|
|
|
|
|
Hello,
You use the term "form", can you be more specific as to what kind of MFC Object you are referring to?
Maybe this might help:
COLORREF SetBkColor(<br />
HDC hdc,
COLORREF crColor
);
usage:
<br />
CPaintDC dc(this);
COLORREF crText;<br />
crText = RGB(128,128,255);<br />
dc.SetBkColor(crText);
Soliant | email
"The whole of science is nothing more than a refinement of everyday thinking." -Albert E.
|
|
|
|
|
I'm sorry. I should have been more specific.
I am building an ODBC database. The form naturally is the user interface where the fields are.
Thanks a lot for your time.
|
|
|
|
|
(Just a note for the future, when you say "form", C++ programmers probably won't understand what you mean. The term to use is "dialog" or "CFormView" if you're using that MFC class.)
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|