|
ShellExecute(...) ?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
:-OShellExecute () is obviously a good option but i am not sure about your problem. whether it can be solved thru this or not because i haven't worked on batch files. but you can give it a shot..all the best..
cheers
himanshu
|
|
|
|
|
xxhimanshu wrote:
but i am not sure about your problem
Me?
I don't have a problem.
rishabhs had one.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Yes it is possible, but you may need use the following syntax
cmd.exe /c D:\Utils\GetIP\PostIP.bat
Where cmd.exe if found by, in a "DOS", box typing:-
echo %comspec%
|
|
|
|
|
Hi
I've made a service which listens at a particular port for any requests coming from IE, and when i get the request
I want to send some specific message to be displayed in html format by IE in order to do that I made following
HTTP response header
aString = "POST / HTTP/1.0\r\n\r\n";
aString += "Accept: image/gif, *.*\r\n";
aString += "Accept-Language: en\r\n";
aString += "\r\n";
aString += "User-Agent: MyAgent \r\n";
aString += "\r\n\r\n";
aString += " Hello, World. \r\n\r\n";
but something is going wrong and IE is unable to understand the response.
Can anyone help me correct the problem ?
Ciao
- Nilesh
|
|
|
|
|
The header that you are using is HTTP request header, that must be sent from client(WebBrowser) to server(WebServer).
The HTTP response header, that is sent back from server to client, should have format like this.
----------------------------------------------------
HTTP 1.0 200 Document follows
MIME-version: 1.0
Server: CERN 3.6
Date: Thursday, 13 June 96 12:30 GMT
Content-Type: text/html
Content-Length: 2103
Last-Modified: Wednesday, 12 June 96 23:53 GMT
...
----------------------------------------------------
* copy from [http://www.cs.sfu.ca/cs/undergrad/CourseMaterials/CMPT365/material/slides/A10.html]
You can study HTTP protocol from http://www.w3.org/
|
|
|
|
|
You should give it a tag name, such as : Accept: image/gif
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
I want to monitor the packets passing through my Network Card using winsock2.
Please if you can help me in doing so?
boby12
|
|
|
|
|
winsock can not snatch the packet, you should try IP protocol
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
Hi,
I have recently learned VC++ and am looking to contribute towards VC++ projects for free. This would help me get some experience in real life projects, please do not hesitate to contact me at tiglic_acid@yahoo.ca .
Appreciate it. Thanks
/TA
|
|
|
|
|
Sure check out:
http://sourceforge.net/projects/vcf[^]
I'm always looking for people to help out.
Of course this may not be what you are looking for, but hey, it's worth a shot!
Plus I give a free trip in the Batmobile at the end of the month to all the team members.
¡El diablo está en mis pantalones! ¡Mire, mire!
|
|
|
|
|
I coding 1 app SDI. My application have to support multilanguage. I'd try change text on menu but it doesn't work. Could you help me ? Thanks !
|
|
|
|
|
u need to make a separate resource dll for the languages u want to support ... make sure as well u use unicode or u will get into trouble later on ... make sure u dont hard code message box strings in the code ... pull them from the string table
etc etc
good luck
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
You can use string substitution while your app startup
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
I have an application that I really want to move a good portion of the code out into a dll. This is all code that is static and will not change over over the life of the application and contains mostly static data (strings and such).
I know what I want to do, but I can't figure out how to write the dll correctly to be able to access the one exported function. Does anyone have any good books that you would recommend to assist me in understanding the process of creating the dll, then the code needed to be able to use the exported function.
Thanks for the help,
-Eric
PS
I have tried understanding the help files in evc++ and msdn about using _declspec but when I attempt to use GetProcAddress() I always get NULL returned.
|
|
|
|
|
make you public header for your function(s)
foo.h
#ifndef _FOO_H__
#define _FOO_H__
#ifdef USE_MY_LIBRARY
#define MY_LIB_API __declspec(dllimport)
#else
#define MY_LIB_API __declspec(dllexport)
#endif
#extern "C" {
MY_LIB_API void MyFunc( int aValue );
}
#endif
implement the function in some file that is compiled for your DLL
say
Foo.c
#include "Foo.h"
void MyFunc( int aValue )
{
//do something
}
when you compile the DLL make sure that USE_MY_LIBRARY is NOT defined. this will ensure that you are using the __declspec(dllexport) form of the function and will automatically export the function for you.
You should end up with a DLL that exports a single function (assuming these are the only files). The extern "C" guarantees that you will not have name mangling.
You can use the DLL with either LoadLibrary() and GetProcAddress(), which is the hard way, or you can make sure that your DLL project emits a .lib file and in the project that uses the DLL, link with this .lib file. If you choose the latter method, make sure that USE_MY_LIBRARY is defined.
Cheers and hope this helps
¡El diablo está en mis pantalones! ¡Mire, mire!
|
|
|
|
|
Another way of doing it would be for you to learn COM+ wich is the standard that Microsoft uses for Dll's.
I find COM+ the easiest way of doing it. Preferably by using ATL but you can do it with MFC aswell.
Any respectible book about MFC or ATL would do for you. Just make sure that the MFC book contains chapters about COM/Automation/OLE.
/Martin
|
|
|
|
|
I have a list box, and want the user to be able to search by typing, for example "pagescan" and have it match the first instance of "Read_Page_Scan_Enable" or "Write_Page_Scan_Enable". To accomplish this, I specified the LBS_WANTKEYBOARDINPUT style for the list box. In the WinProc for the parent window, I handle WM_VKEYTOITEM to build up a buffer of recent keys (with a timeout) and do a customized comparison (ignore case, ignore underscores, if not present in user-typed text, ignore Set_, Read_, Write_ in the list item text). I find the first match, or if none, consider the item at index 0 to match. I send an LB_SETCURSEL message to select the item, and dutifully return -2 from WinProc. The documentation for WM_VKEYTOITEM states:
"A return value of –2 indicates that the application handled all aspects of selecting the item and requires no further action by the list box."
And yet... If I type "pages" everything functions for p,a,g,e and I see the search narrow to the proper item (none of those letters are present as the first letter of any of the strings for any items in the list) but as soon as I type the S key (there is an item starting with S), the list box jumps to the first string starting with S!!! That is so completely screwed up...I think NT stands for "Not Tested"...does anyone know a workaround for this?
Thanks in advance,
Brian
|
|
|
|
|
I did find a workaround, but it isn't very nice...here it is:
SendMessage( (HWND)m_commands_list, LB_SETCURSEL, matching_index, 0);
m_windows_suck_workaround = true;
Then way back out in WinMain, in the Translate/Dispatch loop:
if(msg.message == WM_CHAR && m_windows_suck_workaround)
{
m_windows_suck_workaround = false;
continue;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
It's actually not quite as indicated because of the objects involved (the m_ prefix betrays the fact that it's a member variable in an MDIChildWindow_t subclass but the above code shows the gist of it.
The question still stands, but I'll rephrase it as does anyone know a more appropriate workaround?
Thanks,
Brian
|
|
|
|
|
ummmmm have u tried trapping the pretranslatemsg() for the dialog and filtering there too to stop the default listbox behaviour?
just a thought
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
Is there any way not to save the data at once. I would like to have a Ok and a Cancel button and not save the data till they hit ok.
Is there a way of doing this with a CDataGrid in VC++ 6.0.
thanks
Scott
|
|
|
|
|
can i use WM_TIMER and SetTimer without a Thread?
how must i use it?
can somebody give me an example?
thanks
sunny
|
|
|
|
|
Sunnygirl wrote:
can i use WM_TIMER and SetTimer without a Thread?
No. On the other hand, without a thread you don't have any code running, so that shouldn't be a problem.
Perhaps your question is if you can use SetTimer and handle WM_TIMER messages in the main thread? In that case the answer is an obvious Yes. For examples, please look it up yourself. MSDN, Google, even CodeProject itself contains lots of example code.
|
|
|
|
|
Hello,
I'am doing a mfc dialog based program. In this one, I have a settings dialog box that should allow the user to select somethings through check boxes. The problem is that I've a lot of checkbox in this dialog (18 check box even more later!).
I wanted to do array of controls in my settings dialog box (just like in VB). In order to do that I've short-circuited Class wizard to create an array of CButton member variables but I still have to enumerate each variable for each ID of each control with the DDX_Control(...) macro.
There is also another problem.
If the member variable is defined like this:
CButton m_variable1;
I can use the following statement:
m_variable1.SetCheck();
But if I use the following declaration:
CButton m_variable[18];
m_variable[0].SetCheck();
I'have a assertion failed.
Can somebody give me a smart way to do such array of control?
Thanks a lot.
T. Varidel
|
|
|
|
|
The smart alternative: A list box of checkboxes, via the CCheckListBox class.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|