|
m_Spin1.SetRange32(0, 72270);
m_Spin1.SetBuddy(GetDlgItem(IDC_EDIT1));
void Answer::OnDeltaposSpin1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMUPDOWN pNMUpDown = reinterpret_cast<lpnmupdown>(pNMHDR);
SetDlgItemInt(IDC_EDIT1,m_Spin1.GetPos());
*pResult = 0;
}
|
|
|
|
|
I guess you have to remove UDS_AUTOBUDDY style from the spin button control and set this style UDS_SETBUDDYINT .
Nibu thomas
Software Developer
|
|
|
|
|
I am trying to make a very simple debugger. In fact, it always has to do the following:
Open a program and pause the execution right away. // Like starting the debugger in VC++ with "Step Into"
Then it needs to write some data into memory, I know how to use WriteProcessMemory() for that
Then it needs to resume execution, and if possible have the debugger close without closing the new process.
I'm not very familiar with the debugging functions, only Read and WriteProcessMemory, so if someone could provide sample code to do the above, or at least explain how I can open a process and have it paused right away, and how to resume the execution and close the debugger without closing the process.
Thanks for any help!
|
|
|
|
|
You can use CreateProcess to execute the exe with CREATE_SUSPENDED style this will start and pause the exe at the begining, you can later resume the process.
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Thanks. I got it working, but there is one thing that would make it a lot easier...
Is there a way to get the address of the Entry point of the program after using CreateProcess with CREATE_SUSPENDED. I know it stops it at the Entry point, but I don't know how to get the address of it. Thanks again.
|
|
|
|
|
Get the Debugging Applications - Ms Press by John Robin. The book does show on how to develop one simple debugger with some sample codes.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi all,
I'd like create an MDI application with CView as view. I need to show 10 different displays for the 10 diffent menu items. Now I have the information to be displayed (say a CString object) in the View class. I change this data according to the menu item. But I am getting the latest information in all the views. I should be able to see all the displays at a time.
How can I handle this situation.
Thanks in advance,
Sarvan AL
|
|
|
|
|
Hi,
Use multiple views and splitter windows.
Splitter Windows[^]
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
Hi guys,
What is _T Generic Text Mapping.
Vivek.S
You only have to do a very few things right in your life so long as you don't do too many things wrong.
|
|
|
|
|
|
_T is a macro that is defined in tchar.h
If your compilation is a unicode one it will make that string a wide char type.
This is how it is defined...
#define _T(x) __T(x)
#define __T(x) L ## x
Nibu thomas
Software Developer
|
|
|
|
|
I always use TEXT , but heys thats just preference
It's a unicode thing... I'm going to make the assumption your now wondering what unicode is and suggest you check out this[^] article.
Check out this[^] article for an explaination about what the _T macro actually does.
It's worth getting into the habit of using the unicode ready versions of functions and the _T as it makes moving over to a unicode environment alot easier, especially when working on large projects (been there, done that - hopefully never again...)
Gavin Taylor
w: http://www.gavspace.com
-- modified at 1:01 Monday 20th March, 2006
|
|
|
|
|
Hi all
I am splitting a Text file and then merging its splitted parts.There is no problem in spitting the file, the total of size of all splitted parts remains same to original file but when i am merging those splitted parts the size of new file get increased as compare to original file.
//I have used this approach
iFile= fopen(sns,"r");
size=filelength(fileno(iFile));
char* buff1 =new char[size];
numread= fread(buff1,sizeof(char),size,iFile);
fseek(dFile,n,SEEK_SET);
numwrite= fwrite(buff1,sizeof(char),size,dFile);
fseek(dFile,0,SEEK_CUR);
n=ftell(dFile);
Thanx in advance;
alok singh chauhan
|
|
|
|
|
When I need to simulate a keyboard press event, I know I could use keybd_event or even PostMessage. How do I type a unicode character using PostMessage? Any help or pointers in this direction is greatly appreciated.
Aljechin Alexander
|
|
|
|
|
i want to identify that machine is online or offline through programming.if anybody know how it is possible and have any example please share with me .
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Bankey Khandelwal wrote: i want to identify that machine is online or offline through programmin
InternetGetConnectedStateEx
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
This[^] will make good reading too.
Nibu thomas
Software Developer
|
|
|
|
|
Im looking for MS Visual C++ Naming conventions. The naming conventions I know are from Visual Basic. I don't know if its ok to adopt the naming conventions from VB. If you know some articles on Visual C++ please let me know. Thanks.
|
|
|
|
|
|
I have some codes work properly under 32bit windows, but can't work under x64-based windows, such as win2003server/win64 XP pro, i don't want to rewrite my code, what should i do?
I am still use VC6 with service package5, can it compile the 64bit application
Tomorrow may not exciting, but the exciting tomorrow will surely come.
-- modified at 21:38 Sunday 19th March, 2006
|
|
|
|
|
VC++ 6.0 / Visual C++ 2003 are strictly 32bit, Visual Studio 2005 (including express editions) are the first offical Microsoft compilers to support x64 builds - From what I remember some of the more recently DDK's released before VS 2005 shipped with some sort of x64 support aswell but can't verify that though as I don't have any to hand.
Most code should be a pretty easy move across, it's worth checking out this[^] set of articles on MSDN which are a pretty good starting point on the new compiler, some of it's driver development specific but most of it's going to be relivent.
<edit>If your having problems actually running VS 6.0 on x64 - I don't know about that one and wont be able to try it until midweek, but I do know 2003 works fine</edit>
Gavin Taylor
w: http://www.gavspace.com
-- modified at 22:30 Sunday 19th March, 2006
|
|
|
|
|
It seems that i have to use the VS .NET 2005 to solve my trouble, any way, thanks very much!
|
|
|
|
|
i have 2 files :
file1.txt have a stream of "1010011"
file2.txt have a message :
The amount of energy used in buildings depends firstly on WHAT IT IS USED FOR.
i want to print to file3. the algoritm is simple:
read all char in file2 one by one and print in file3<br />
if char in file2 == space <br />
if char in file 1=='1'<br />
print 2 space in file3<br />
else if char in file1=='0'<br />
print 1 space in file3
below is my code
Binary=fopen("file1.txt","r");<br />
Message=fopen("file2.txt","r");<br />
Output=fopen("file3.txt"."w");<br />
while(true)<br />
{<br />
BinaryBuff=fgetc(Message);
if(feof(Message))<br />
break;<br />
<br />
else if (BinaryBuff=='A')<br />
fprintf(Output,"A");<br />
else if (BinaryBuff=='B')<br />
fprintf(Output,"B");<br />
else if (BinaryBuff=='C')<br />
fprintf(Output,"C");<br />
<br />
else if(BinaryBuff==' ')
{<br />
while (true)<br />
BinaryBuff==fgetc(Binary);<br />
if(BinaryBuff=='1')<br />
fprintf(Message," ")
else if (BinaryBuff=='0');<br />
fprintf(Message," ");
<br />
}<br />
<br />
}
the output in file3 should be :
The(2space)amount(1space)of(2space)energy(1space)used(1space)in(2space)buildings(2space)depends firstly on WHAT IT IS USED FOR.
but not work. what can i do???
HelpMe
|
|
|
|
|
Give more details - what do you mean "does not work"? It crashes? Nothing in output file?
From looking at the code, beardy janggut wrote: fprintf(Message," ")//print 2 space
this tries to write the spaces to the MESSAGE file - should be to OUTPUT.
|
|
|
|
|
I'm an infant when it comes to C++.
Can anybody help me to access a text file which has a comma that separates every item and after which put that file into an array which can be access later.
The problem is the items in a file are in this manner, each line:
char,int,int,int,long int,long int........
char,int,int,int,long int,long int........
char,int,int,int,long int,long int........
char,int,int,int,long int,long int........
........
.............
.........
......
upto 57-60 lines
Do i have to separate the char and int and long int and put it in different array?
Or put the items in a struct....
|
|
|
|