|
I need to display a picture in a custom static control. but when the size of image is larger than the control i need a scroll bar (up-down)(left-right)..so how do i attach a scroll bar in static control and scroll the image...help please...
sanjay
|
|
|
|
|
try creating the static control with WS_VSCROLL and WS_HSCROLL styles then handle the scroll messages
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
I need a Sha Encription alogorithm. Anyone could please help me?
|
|
|
|
|
|
1) Encryption is written with Y
2) The SHA algorithm is no encryption, it is an hash algorithm.
Don't try it, just do it!
|
|
|
|
|
I have a little menu here which i want to execute my functions using it.
So i have problems in entering the process like notepad which i want to create, but then it crushes.
How can i declare the variable which will take care of the input process, because i didn't want to include it in the commandline when running. Part of my code is below
<br />
#include <windows.h><br />
#include <stdio.h><br />
#include <windef.h><br />
#include <winbase.h><br />
#include <imagehlp.h> <br />
LPVOID lpMsgBuf;<br />
<br />
int menu(void)<br />
{<br />
int choice;<br />
<br />
printf ("\n");<br />
printf ("*****************************************\n");<br />
printf ("*\t\t\t\t\t*\n*\tCHECKPOINTING SYSTEM \t\t*\n");<br />
printf ("=========================================");<br />
printf ("\n=\t 1: Create a process \t=");<br />
printf ("\n=\t 2: Shutdown the process\t=");<br />
printf ("\n=========================================\n");<br />
printf ("\n");<br />
<br />
printf("\nEnter choice (1-2): ");<br />
scanf("%d", &choice);<br />
return choice; <br />
}<br />
int main(int argc, char **argv) <br />
{<br />
PROCESS_INFORMATION pi ; <br />
STARTUPINFO si; <br />
LPDWORD lpExitCode = 0;<br />
HANDLE hProcess ; <br />
DWORD baseaddr = 0;<br />
DWORD error = GetLastError();<br />
LPCTSTR lpApplicationName="";<br />
<br />
int choice;<br />
menu();<br />
<br />
while((choice = menu())!=3)<br />
{<br />
switch (choice)<br />
{<br />
case 1: <br />
printf("Enter process you want to execute: ",lpApplicationName);<br />
scanf ("%s",lpApplicationName);<br />
printf("Process %d reporting for creation\n",GetCurrentProcessId());
GetStartupInfo(&si);<br />
CreateProcess(NULL, <br />
argv[1], <br />
NULL, <br />
NULL, <br />
FALSE, <br />
CREATE_NEW_CONSOLE, <br />
NULL, <br />
NULL, <br />
&si, <br />
&pi <br />
); <br />
hProcess = pi.hProcess;<br />
printf("New Process ID: %d ",pi.dwProcessId);<br />
printf("has started \n"); <br />
break;<br />
case 2:<br />
<br />
TerminateProcess(pi.hProcess, GetExitCodeProcess(hProcess,lpExitCode ));<br />
GetLastError();<br />
<br />
break;<br />
default: printf("\nInvalid choice: ");<br />
}
}<br />
return(0);<br />
}<br />
oam
|
|
|
|
|
Try this:
#include "stdafx.h"<br />
#include <stdio.h><br />
<br />
int menu(void)<br />
{<br />
int choice;<br />
<br />
printf ("\n");<br />
printf ("*****************************************\n");<br />
printf ("*\t\t\t\t\t*\n*\tCHECKPOINTING SYSTEM \t\t*\n");<br />
printf ("=========================================");<br />
printf ("\n=\t 1: Create a process \t=");<br />
printf ("\n=\t 2: Shutdown the process\t=");<br />
printf ("\n=========================================\n");<br />
printf ("\n");<br />
<br />
printf("\nEnter choice (1-2): ");<br />
scanf("%d", &choice);<br />
return choice; <br />
}<br />
<br />
void main(int argc, char **argv) <br />
{<br />
PROCESS_INFORMATION pi ; <br />
STARTUPINFO si; <br />
HANDLE hProcess;<br />
TCHAR lpApplicationName[100]="";<br />
<br />
int choice;<br />
<br />
while((choice = menu())!=3)<br />
{<br />
switch (choice)<br />
{<br />
case 1: <br />
printf("Enter process you want to execute: ",lpApplicationName);<br />
scanf ("%s",lpApplicationName);<br />
printf("Process %d reporting for creation\n",GetCurrentProcessId());
GetStartupInfo(&si);<br />
CreateProcess(NULL, <br />
lpApplicationName, <br />
NULL, <br />
NULL, <br />
FALSE, <br />
CREATE_NEW_CONSOLE, <br />
NULL, <br />
NULL, <br />
&si, <br />
&pi <br />
); <br />
hProcess = pi.hProcess;<br />
printf("New Process ID: %d ",pi.dwProcessId);<br />
printf("has started \n"); <br />
break;<br />
<br />
case 2:<br />
<br />
TerminateProcess(pi.hProcess, 0);<br />
break;<br />
<br />
default:<br />
printf("\nInvalid choice: ");<br />
}<br />
}<br />
}
And don't be as lazy as to believe anything you see...
"though nothing
will keep us together
we can beat them
for ever and ever"
rechi
|
|
|
|
|
Im sorry im using C language and now i'm having a problem with the header file
stdafx.h because i think it works in C++.
the error i'm getting shows this after adding the header file to the project.
<br />
Compiling...<br />
pro.c<br />
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(15) : fatal error C1189: #error : MFC requires C++ compilation (use a .cpp suffix)<br />
Error executing cl.exe.<br />
<br />
pro.obj - 1 error(s), 0 warning(s)<br />
oam
|
|
|
|
|
Comment the #include "stdafx.h" line.
"though nothing
will keep us together
we can beat them
for ever and ever"
rechi
|
|
|
|
|
well now it works even after re-including the header file.
But now it does not create the notepad process and im amazed that its ID is -858993460 though it doesn't appear
oam
|
|
|
|
|
It does. Check out the source again and look for GetStartupInfo(&si) . Reinsert it into your code.
No, wait! Just replace it with:
<br />
<br />
ZeroMemory( &si, sizeof(si) );<br />
si.cb = sizeof(si);<br />
ZeroMemory( &pi, sizeof(pi) );<br />
"though nothing
will keep us together
we can beat them
for ever and ever"
rechi
|
|
|
|
|
I replaced the code lines you suggested but still it doesn't showup the process running, i.e. notepad or cmd. I tried to tackle it anyhow but still... and what i am concern with is that the process ID it shows is the same everytime i try to create it
oam
|
|
|
|
|
Ok i manage to solve it.
Thanks anyway.
oam
|
|
|
|
|
i got the function...delete() but could anyone tell me the parameters to b passed..
its been told to pass the index..
but how to get the index...
plzz help me urgently
|
|
|
|
|
|
alok
c i have assigned the string from the file to a variable..
so to delete which function should i call..
plz tell me fast....
|
|
|
|
|
Ok if you assigned the File Buffer to CString Variable.
Then you can use CString::Replace(..) to replace all text with ""
Some thing like this
[Code]
CString szTmpString="CodeProject was Great Site";
szTmpString".Replace("was","is");
In your case replace [text to remove] with ""
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
Your request is a bit vague. What exactly is it that you are trying to delete? A file? Some text within a file? A pattern within a string variable? Please elaborate.
Also, have you seen this or this?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have recently downloaded VC++ 2005 express beta from microsoft. I have the .Net framework also but have yet to get the MSDN component down.
Any VC++ 6.0 projects that access the MFC classes of visual studio 6 fail to compile because the headers (e.g AFXWIN.H) are missing. Will the MSDN component include these or do I need to look elsewhere. A disk search only showed this file as existing under V6.
Ger
|
|
|
|
|
MFC is shipped with all versions EXCEPT express versions.
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
Hi,
Does anyone know how to prevent a view from being closed? I have a situation where I need a 'Master' view which is always open. It can be minimized/maximized but I need to prevent the user from closing it.
I am working in an MDI situation where there are other views which are written 'better' than others, therefore can be opened/closed without adverse effects on the document. However this legacy view currently needs to be locked until such time as I get time to re-write it.
If anyone can help I would really appreciate it.
Many thanks
Rob
|
|
|
|
|
Try the ON_WM_SYSCOMMAND message on the given child frame. And in the OnSysCommand function test:
UINT nItemID = (nID & 0xFFF0);<br />
if(nID == SC_CLOSE)<br />
{<br />
}
call the base class method.
I hope this help
Abyss
|
|
|
|
|
Thank you very much, this worked a treat.
Rob
|
|
|
|
|
Put a handler for WM_CLOSE in your MDI Frame class (not the view class, the frame class). In VC6.0 you can do this through ClassWizard, it will put the right member function prototype, messagemap macro and member definition in your project. If you don't want to close the MDI frame (and hence the view) just don't call the base class implementation of OnClose (usually CMDIChildWnd::OnClose()).
This will prevent the MDI frame/view from being closed, but you can still close the application (the mainframe wnd) as usual. If you want to avoid this, put a handler for WM_CLOSE in the mainframe class as well.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
when we open the bitmap,bitmap will appear on the screen
and when we want to save the bitmap in different colour format like 24-bit,256-bit,16-bit,monochrome (not format like GPEG,GIF,TIFF etc) e.g. when we run MSPAINT and open one bitmap and save this bitmap as 256,24 etc.these option are avilable in MSPAINT.i want exact application to save the bitmap in different colour format(24,256 etc).
|
|
|
|