|
|
|
In VC6, in the File Open dialog, use the 'Open as' dropdown list and select 'Binary'.
In VS.NET, in the File Open dialog, click on the dropdown attached to the Open button and select Open With... Select Binary Editor from the list.
In either case, this will open the file in the IDE's binary editor, which lets you change the file contents in hex. Use this to examine and correct the problems in the file.
Good luck.
Software Zen: delete this;
|
|
|
|
|
Where Coudle I Get IDE's binary editor?
Thanks
Just do it !
|
|
|
|
|
Hello all.
I am fairly new to programming with Visual C++. I am currently using version 6.0. I have done a lot of work in VB in the past, and am trying to migrate over to VC.
I am wondering if someone can point me in the right direction here. I am just tinkering around at this point. I've got an MFC program, with a listbox. I found some code and modified it for my liking. It's just simple code that searches the c:\ drive for all files and folders. If it finds a folder, it searches that folder too. It adds all of the files/folders to the listbox (m_ListBox.AddString()) is what I'm using. I'm also doing an m_ListBox.UpdateWindow() after each addition to ensure the window shows the contents correctly.
The problem I am running into is that since there are so many files on the C: drive, it takes a long time for the program to find them all. It adds the items very fast to the listbox, but what is happening is it is "locking up" the program (so to speak). Not Responding will show up on the window title, and it does not allow me to go into the listbox and click on the UP/DOWN arrows to scroll through while it is working.
In VB, I would use the function "DoEvents" and that would cause the program to let other things happen meanwhile. I am wondering how I would go about doing this in VC+?
Any pointers or hints or links to some documents that may be able to help me would be very much appreciated.
-Shultas
|
|
|
|
|
You will have to create a worker thread via CreateThread and find files in that thread and then send a WM_USER message from that thread to ur window which will eventually add items in the list control
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
|
Hi friends,
I'm going to compose a new bitmap by myself, and I'm using buffer to store up the data inside bitmap. But I did it wrong, and I get conflicts on that. can somebody help me and teach me how to store up correct contents in buffer??
I just want to draw a black "cross" on the center of bitmap with (1024x1024 pixel)
unsigned char *mBuffer = NULL;
int i;
int mByte = 1024/8;
int mWidth = 1024;
int mHeight = 1024;
for(i=1; i<=mHeight; i++)
{
if(i< mHeight/2)
{
memset(mBuffer+(i*(mWidth/2)), 0xff, 1);
}
else if(i==mHeight/2)
{
memset(mBuffer+(i*(mWidth)), 0xff, mByte);
}
else
{
memset(mBuffer+(i*(mWidth/2)), 0xff, 1);
}
}
forgive my stupid~, I really don't know how to store up the buffer..
thanks for help
|
|
|
|
|
Forget the buffer appoarch!
Creating for latter use:
1) Create a display compatible device context (memory DC).
2) Create a compatible bitmap of the size needed.
3) Select the bitmap into the device context.
4) Use GDI to draw the cross on the bitmap.
5) Select the previous bitmap into the device contest.
6) Delete compatible device context.
If you are keeping a copy of the bitmap for latter use, then you are all set.
In OnDraw():
1) Create compatible device context (memory DC).
2) Select bitmap into DC.
3) Blit to window.
4) Select previous bitmap into DC.
5) Delete compatible DC.
If you do not need to keep a copy of the bitmap.
In OnDraw():
1) Create a display compatible device context (memory DC).
2) Create a compatible bitmap of the size needed.
3) Select the bitmap into the device context.
4) Use GDI to draw the cross on the bitmap.
5) Blit to window.
6) Select the previous bitmap into the device contest.
7) Delete compatible device context.
INTP
|
|
|
|
|
Hi
Any one have any ideas on how to determine the size of a directory and any subsirectories?
I tried creating a console application using the _findfirst()/_findnext() functions. I think there must be an easier way.
Thanks in advance for any sugestions/comments.
|
|
|
|
|
Yes! But I would have to do the same reseach you need to. By the looks of it you may have already determine there is more than one way to do it. There are articles at codeproject and elswhere on this subject and there may be something in the FAQ. Try keywords: searching, directory, CFile, find. You also might try searching for passed questions posted, as simular questions have been asked before.
INTP
|
|
|
|
|
When I overide the CWinapp::Run, and drag the toolbar from the Mainframe window, I noticed the mainframe area where the toolbar was does not update. It leaves a blank area. Any ideas?
Thanks
|
|
|
|
|
ok i have very strange problem in first case everything is ok
<br />
int (*handler[15])(int parm); <br />
int user_trans_quit(int parm); <br />
<br />
int user_trans_quit(int parm){ <br />
printf("Just a test %d", parm); <br />
return 0; <br />
} <br />
int _tmain(int argc, _TCHAR* argv[]) <br />
{ <br />
handler[1]=user_trans_quit; <br />
handler[1](1); <br />
} <br />
but when i try to meke OO compiler give me this error "error C2064: term does not evaluate to a function taking 1 arguments"
<br />
#pragma once <br />
class PacketHandler <br />
{ <br />
private : <br />
<br />
public: <br />
PacketHandler(void); <br />
~PacketHandler(void); <br />
int LoginAck(char *parm); <br />
void Action(int i, char *data); <br />
int (PacketHandler::*handler[255])(char *parm); <br />
}; <br />
.... <br />
#include "StdAfx.h" <br />
#include ".\packethandler.h" <br />
<br />
PacketHandler::PacketHandler(void) <br />
{ <br />
handler[1]=LoginAck; <br />
} <br />
<br />
PacketHandler::~PacketHandler(void) <br />
{ <br />
} <br />
int PacketHandler::LoginAck(char *parm) <br />
{ <br />
return 0; <br />
} <br />
void PacketHandler::Action(int i, char *data) <br />
{ <br />
handler[i](data);
} <br />
10x in advance
PS:sry about my bad english
|
|
|
|
|
TRY...
define "LoginAck" as a static function
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
|
I think XSimon is correct about making LoginAck() static. You also need to forward declare your class type "class PacketHandler". Of cource I understand this is only a sample, so the lack of a contructor I am ignoring. The line "handler[1]=LoginAck;" gives the impression you are thinking that the array starts at 1, it does not, the range is 0 to 254. If you want 0 - 255 use 256 instead of 255 in your declaration.
Considering where the error occurs, you probably need to declare "int (PacketHandler::*handler[255])(char *parm);" as static.
God luck!
INTP
|
|
|
|
|
found the problem 10x alot
i must call function in this way (this->*handler[i])(data);
.. dont know way its look totaly stuped for me .. but its work
10x for the help
|
|
|
|
|
I want to make an app that write some text on the taskbar. But everytime WM_PAINT is handled I have to re paint it. My question is how I can hook the taskbar and get notified when WM_PAINT is handled.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
Put the app in a DLL that also contains a basic COM object. Use the SHLoadInProc() function to cause the DLL to be loaded into explorer's address space and an instance of the COM object to be created. In the initialisation of this object, you can subclass the taskbar and handle whatever messages you need. Use spyxx to find the window structure so you can find the taskbar at runtime.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
Hope this helps
Yeah god damnit!
I just have to learn hom to create a COM object...
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
Hi,
I would like to know how I can create a shortcut of a file and put that on the desktop from my MFC sdi application?
|
|
|
|
|
Hi,
See the article how to create IShellLink in Desktop
http://www.codeproject.com/shell/desktopshortcut.asp
With Regards,
R.Selvam
|
|
|
|
|
how to modify system path?
Hi,
How can I modify the system verables (and user variable) PATH from my MFC application?
|
|
|
|
|
Hi,
I am trying to add and edit records to MS Access database from a dialog box. I created a dialog box by using AppWizard. Also, i created a derived class of CRecordset by using ClassWizard. The following is my ONOK function:
void CComplaintDlg::OnOK()
{
// CDatabase complaints;
//complaints.OpenEx("DSN=Complaints",CDatabase::noOdbcDialog);
// complaints.Open("Complaints");
// complaintRecord cr(&complaints);
complaintRecord cr;
cr.Open();
cr.MoveLast();
if(!cr.CanUpdate())
AfxMessageBox("dd");
cr.AddNew();
UpdateData();
cr.m_CallerName = m_Complaint_Name;
cr.Update();
cr.Requery();
cr. Close();
CDialog::OnOK();
}
After i compile and run it, it does not update the data file. What did i do wrong?
Thanks in advance.
csgogogo
|
|
|
|
|
Hi,
you can try the following way,
CDaoDatabase m_db ;
CDaoRecordset *m_set ;
COleVariant m_var ;
CString m_str ;
m_db.Open ( "sample.mdb" ) ;
m_set = new CDaoRecordset ( &m_db ) ;
m_set -> Open ( dbOpenDynaset, "select * from table" ) ;
m_set -> MoveFirst( ) ;
m_set -> Edit( ) ;
UpdateData( TRUE ) ;
m_set -> SetFieldValue( "complientname",( LPCSTR ) m_Complaint_Name) ;
m_set -> Update( ) ;
With Regards,
R.Selvam
|
|
|
|