|
In the handler for your help button handler:
char* path = "c:\\help.html";
ShellExecute(NULL,"open",path,NULL,NULL,SW_SHOWNORMAL);
And there are no "Procedures" in C.
this is this.
|
|
|
|
|
|
Try here[^].
Software Zen: delete this;
|
|
|
|
|
Meaning to bascially substitue the older WinHelp function calls with appropriate parameters to the HtmlHelp function call. So read the MSDN about how to call HtmlHelp .
|
|
|
|
|
Can anyone tell me the best resources for Visual C++. I have worked on C/C++ but i've never had any experience with Visual C++. I need a few tutorials and some reallllly basic ones. Where can i get some? Tutorials that tell you how to create a form use the Microsoft IDE, etc.
|
|
|
|
|
|
hey. could anyone tell me how to send broadcast packets in C. For those of you who dont know what a broadcast packet is:
"If you send a packet to 255.255.255.0 it goes to all the computers on the network"
How can i also listen for broadcast packets. Basically, my requirement is that i have many computers on a LAN (roughtly around 30 - 50), the IP address of which are unknown. So i would like to find oit all the computes that are present on my network. I thinks this is a practical use for sending a broadcast packet.
|
|
|
|
|
to listen for a udp broadcast packet, just create a udp socket on the client machine, binding it to a certain port. eg: 22222. Then broadcasting socket should broadcast on that port.
|
|
|
|
|
okay. How can i create a UDP socket? ...and how can i send the UDP packet. Have you got any code to accomplish this?
|
|
|
|
|
how do i take 2 CStrings and join them to be 1?
im a noobie so i have no clue and cant find anything to read about it
|
|
|
|
|
Example
The following example demonstrates the use of CString::operator +.
// example for CString::operator +
CString s1( "abc" );
CString s2( "def" );
ASSERT( (s1 + s2 ) == "abcdef" );
CString s3;
s3 = CString( "abc" ) + "def" ; // Correct
s3 = "abc" + "def";
// Wrong! The first argument must be a CString.
|
|
|
|
|
|
Any idea how to embed an exectuable inside another executable, and then from with in your program, call the embeded exectuable with out creating another process or wrting the embed exectuable to disk?
I have a C++ program (straight C++, not managed). It has some logic and then depending on a number of conditions, ShellExecute()s another exectble file (client.exe), which happens to be a .net file. Is there anyway that I can add this client.exe file as a resource of my C++ program, and then call the beginning of the code from within the C++ program, so I wouldn't have to extract the resource or create a new process
Please help
Thanks,
Jason A. Donenfeld
PS: This is what I have now:
<br />
#define WIN32_LEAN_AND_MEAN<br />
#include<br />
#include<br />
#include<br />
<br />
#define INSTANCEMESSAGE "ShowZIM"<br />
#define WINDOW_TITLE "ZX2C4InstantMessenger"<br />
#define MUTEX_STRING "Local\\ZX2C4IM"<br />
#define FILE "client.exe"<br />
<br />
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)<br />
{<br />
if(_tcscmp(lpCmdLine,"clone"))<br />
{<br />
CreateMutex(NULL,TRUE,MUTEX_STRING);<br />
if(GetLastError()==ERROR_ALREADY_EXISTS)<br />
{<br />
SendMessage(FindWindow(NULL, WINDOW_TITLE), RegisterWindowMessage(INSTANCEMESSAGE), NULL, NULL);<br />
return 0;<br />
}<br />
}<br />
ShellExecute(NULL,NULL,FILE,lpCmdLine,NULL,SW_SHOW);<br />
return 0;<br />
}<br />
|
|
|
|
|
The following is a general purpose method for retrieving any binary data from your program's resources:
HRSRC resource_handle = ::FindResource(AfxGetResourceHandle(),
MAKEINTRESOURCE(IDR_PROGRAM),
"PROGRAM");
if (resource_handle != NULL) {
HGLOBAL resource_memory = ::LoadResource(AfxGetResourceHandle(),
resource_handle);
if (resource_memory != NULL) {
LPVOID resource_data = ::LockResource(resource_memory);
DWORD resource_size = ::SizeofResource(AfxGetResourceHandle(),
resource_handle);
if ((resource_data != NULL) && (resource_size > 0)) {
}
}
} The corresponding resource.h and .RC look like this:
#define IDR_PROGRAM 1234
IDR_PROGRAM PROGRAM "Program.exe" I've used this method a number of times. It's handy for simple programs. For example, I've got a tool application that consists of a single .EXE and a help file. Rather than make an install, I include the help file in the .EXE as a resource, and extract it as necessary.
Software Zen: delete this;
|
|
|
|
|
Oops . I didn't see your qualification about not extracting the executable. Sorry.
I don't think what you're asking is possible under Windows. An executable is actually a set of data structures, along with the compiled code. The loader is responsible for reading those data structures and the code, placing that in memory and then running it. You would have to somehow emulate the loader process, or invoke it yourself. I don't know of a public API that lets you do that.
Software Zen: delete this;
|
|
|
|
|
Hi there...
i am using CFileDialog to save and move files...
but i need to add an edit box in that dialog so users
can add comments...
can i overwrite/edit sumthing in CFileDialog class to add
new controls?
tnx 4 d help
|
|
|
|
|
|
I am updating a Visual C++ program's GUI, and I am getting some parsing errors from by the Visual C++ class wizard for one of the classes.
One of the parsing errors has the following form:
In file WizardDlg.h, I have
// Dialog Data
//{{AFX_DATA(CWizardDlg)
enum { IDD = IDD_WIZARD_DIALOG };
CButton m_button[3];
//}}AFX_DATA
In file WizardDlg.cpp, I have:
void CWizardDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CWizardDlg)
DDX_Control(pDX, IDC_BUTTON3, m_button[0]);
DDX_Control(pDX, IDC_BUTTON2, m_button[1]);
DDX_Control(pDX, IDC_BUTTON1, m_button[2]);
//}}AFX_DATA_MAP
}
The code compiles, but I get the class wizard parsing error
Parsing error: Expected ";".
Input Line: "CButton m_button[3];"
I know one way to fix this error: replace the array with three separate CButton m_button instances, i.e.
CButton m_button1;
CButton m_button2;
CButton m_button3;
DDX_Control(pDX, IDC_BUTTON1, m_button1);
DDX_Control(pDX, IDC_BUTTON2, m_button2);
DDX_Control(pDX, IDC_BUTTON3, m_button3);
However, I may not be able to use this approach without changing a lot of code. Is there a way to make the parser accept the CButton m_button[3] array, or something like it?
This is an important project for work, so any advice would be greatly appreciated.
|
|
|
|
|
I'm afraid you're out of luck here. The VC6 class wizard is notoriously limited in what it will accept, and arrays of controls aren't part of that.
You can, however, move the array references outside the comment markers used by VC6 (the lines with "//{{ and //}} "), and do things that way. You will need to maintain those entries yourself, but at least it lets you continue using the class wizard for other things.
Software Zen: delete this;
|
|
|
|
|
Hi guys
If I run a program in a DOS console, what should I do to have the time displayed on screen as the program is running:
1) without overhead time
2) without a zillion numbers scrolling down the screen but as a neat counter that sits tight on one single place.
Thanks!
|
|
|
|
|
|
You could use the backspace (^H, ASCII 8) character to return to the start of the line in order to overwrite it.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I recently ran into the situation where a bitmap displayed different results for pixels (255, 0, 255 vs. 248, 0, 248) on a desktop PC and a pocket PC. I've looked around for comments on this but haven't found anything. Does anyone have any information as to how this is possible????
|
|
|
|
|
|
If any of you ever typed "///" in a c# document...it'd generate these nice xml summary blocks.
Are their any extensions to vs.net that do this sorta stuff to c++?
|
|
|
|