|
But if I have a pe file and then I append some data to the file,I want to get the original pe file size,not the size after modified!
I skim the winnt.h and find that I must sum all the section size and directory size to count the size of pe file.I want to if there is a structure member in the pe file that can show me the size directly!
Thanks for help!
----------
Don't look at me in that way!
|
|
|
|
|
tell me exactly what are you creating then may be i'll be able to help you
Regards,
Pankaj Sachdeva
|
|
|
|
|
At first!Thank you for help!
I just want to get the orginal pe file's size,maybe the pe file was modified by some other program(ex.Append some data to the end of the orginal pe file).So the size I get from API is not the size of the original file.
I want to get the original pe file size ,so I have to follow the pe format and sum all it's section size and directory size.
Can you help me on getting a easy way to find out the original file size!
Thank you very much!
----------
Don't look at me in that way!
|
|
|
|
|
The scenario here is that I have a main dialog. When I press a certain button, a new dialog appears.
Along with this new dialog, I also have a 2nd new dialog not really a part of the application itself, a settings dialog of a scanner which was just invoked by my application. So basically, I have to new dialogs.
What I want to do is to put the 2nd dialog on top of the 1st. The problem is after OnInitDialog() of the 1st, ShowWindow() is invoked so it stays on top. The 2nd dialog must be on top of my application only, not on other windows.
Any help would greatly appreciated. Please tell me if you need more information.
Thanks!
|
|
|
|
|
Use SetWindowPos .
SetWindowPos(hwndDlgTobeOnTop,
hwndAppDlg, ...).
|
|
|
|
|
yeah, i did that too.. the 2nd dialog is invoked inside OnInitDialog of the 1st. So even if I called SetWindowPos, after the call to OnInitDialog, the 1st stays on top of the 2nd because of the implicit call to ShowWindow().
Both dialogs must appear at the same time only that the 2nd needs to be on top of the 1st.
|
|
|
|
|
Have you tried modeless dialogs?
|
|
|
|
|
Hello There,
This is my first post..so bear with me if I am bad at explanation!I am not able to solve this n need immediately for project..so..
I need to Load some data from XML document into ComboBox,but I want to error out if I have duplicate data.
Ex:-
<Employees>
<Employee Name"AAA">
<ID>1<ID/>
<Employee>
<Employee Name"ABC">
<ID>2<ID/>
<ID>2<ID/>
<Employee>
<Employee Name"AAA">
<ID>1<ID/>
<Employee>
<Employees/>
Here I need to load comboBox1 with AAA and ABC and show up error that there is Duplicate entry for an Employee NAme="AAA".
I need to load second Combo Box with ID's.And Error out if there are duplicate entries for this.
I ran an Xpath Query
CString strQuery ("//Employees/Employee");
_bstr_t QueryString;
QueryString = strQuery.AllocSysString();
CString strName ("name");
_bstr_t name;
name = strName.AllocSysString();
HRESULT hr15 = m_pXMLDocClassLevelDoc->selectNodes(QueryString,&pNodeListPtr);
then in the for loop I do get_item & get_attribute and get the data in BSTR.
For loading the 2nd ComboBox I run another query with
strQuery.Format("//Employees/Employee[@ID='%s']",strdata1); where strdata1 is selected Employee name in Combo Box1(did it in OnComboSelChange Event).
So I need to show error in MEssageBox with what is duplicated in the XMLDoc.Example here is "AAA"- Employee name or ID= 2.
Please help me on this.
Thanks.
|
|
|
|
|
CDC *pDC;
pDC = GetDC();
DrawLed(pDC,m_nLedColor,m_nLedMode,m_nLedShape);
ReleaseDC(pDC);
I am getting run time error confused:
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
G Haranadh wrote: I am getting run time error
And the error is?
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Have you tried running it through debugger, and what call stack says ?
G Haranadh wrote: DrawLed(pDC,m_nLedColor,m_nLedMode,m_nLedShape);
This is very insufficient information, to guess the problem.
|
|
|
|
|
|
Absolutely not, but like prasad_som said we do not have enough information.
What is the prototype of ‘DrawLed”?
You did not give the header, and more importantly you did not state the library. Without those it is a total mystery.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
void CLed::DrawLed(CDC *pDC,int nLEDColor, int nMode, int nShape)
{
CRect rect;
GetClientRect(&rect);
if(rect.Width() >= LED_SIZE && rect.Height() >= LED_SIZE)
{
int nWidth = rect.Width();
int nHeight = rect.Height();
rect.left += (nWidth - LED_SIZE)/2;
rect.right -= (nWidth - LED_SIZE)/2;
rect.top += (nHeight - LED_SIZE)/2;
rect.bottom -= (nHeight - LED_SIZE)/2;
}
CBitmap TransBitmap;
TransBitmap.CreateBitmap(LED_SIZE,LED_SIZE,1,1,NULL);
CBitmap bitmapTemp;
CBitmap* pBitmap = &m_LedBitmap;
CDC srcDC;
CDC dcMask;
CDC TempDC;
TempDC.CreateCompatibleDC(pDC);
srcDC.CreateCompatibleDC(pDC);
dcMask.CreateCompatibleDC(pDC);
CBitmap* pOldBitmap = srcDC.SelectObject(pBitmap);
CBitmap* pOldMaskbitmap = dcMask.SelectObject(&TransBitmap);
bitmapTemp.CreateCompatibleBitmap(pDC,LED_SIZE,LED_SIZE);
CBitmap *pOldBitmapTemp = TempDC.SelectObject(&bitmapTemp);
TempDC.BitBlt(0, 0, LED_SIZE, LED_SIZE, pDC, rect.left, rect.top, SRCCOPY);
COLORREF OldBkColor = srcDC.SetBkColor(RGB(255,0,255));
dcMask.BitBlt(0, 0, LED_SIZE, LED_SIZE,&srcDC, nMode*LED_SIZE, nLEDColor+nShape, SRCCOPY);
TempDC.SetBkColor(OldBkColor);
TempDC.BitBlt(0, 0, LED_SIZE, LED_SIZE, &srcDC, nMode*LED_SIZE, nLEDColor+nShape, SRCINVERT);
TempDC.BitBlt(0, 0, LED_SIZE, LED_SIZE,&dcMask, 0, 0, SRCAND);
TempDC.BitBlt(0, 0, LED_SIZE, LED_SIZE, &srcDC, nMode*LED_SIZE, nLEDColor+nShape, SRCINVERT);
pDC->BitBlt(rect.left, rect.top, LED_SIZE, LED_SIZE, &TempDC, 0, 0, SRCCOPY);
srcDC.SelectObject(pOldBitmap);
dcMask.SelectObject(pOldMaskbitmap);
TempDC.SelectObject(pOldBitmapTemp);
VERIFY(srcDC.DeleteDC());
VERIFY(dcMask.DeleteDC());
VERIFY(TempDC.DeleteDC());
VERIFY(TransBitmap.DeleteObject());
VERIFY(bitmapTemp.DeleteObject());
}
SORRY for the late friends..
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
I have a VC++ console application that runs in VS 2005 but fails with an "unhandled win32 exception" when run in the command window. It exhibits this behavior for both the Debug and Release versions of the program, although the Release version does get a bit further along in execution before failing. To increase my frustration, when I accept its offer to debug with a copy of VS, it comes up with a "blank" VS, with no way to inspect state or anything (in Debug and Release). Any ideas on what might be causing this, how to track it down, or where I might look for more information or help would be greatly appreciated.
Regards,
- Roy
Always do right.
This will gratify some people and astonish the rest. - Mark Twain
The truth is rarely pure, and never simple. - Oscar Wilde
|
|
|
|
|
I had a similar problem some time ago with a quick and dirty console app I had knocked up. The problem turned out to be the difference in the environment between launching the app from the ide and from a console window. In my case I was opening a file without using a full path, and not checking that the open was successful (it was a Q&D app!), within the IDE it found the file in the project directory, whereas the starting directory from a console window was different. So one place to start looking may be to see if you are susceptible to differences in environment.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Thank-you. Unfortunately, I took great care to make sure the input was the same in both cases and always used full path names. There is file activity, but based on the program output before it failed, I know I don't have this problem. In fact, the program output of the working (VS) execution and the failing one is exactly the same up to the failure point.
Regards,
- Roy
Always do right.
This will gratify some people and astonish the rest. - Mark Twain
The truth is rarely pure, and never simple. - Oscar Wilde
|
|
|
|
|
In that case all I can suggest is manual debugging - when I need it I use an ofstream with lots of output traces to find the crash point. If you always terminate an output with an endl then the output stream is continually flushed.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Hi All,
I have small application that i add in it some CTreeCtrl control.
In this i need in some cases to disable one of the sub item of some root element and i don't know how to do it.
Some one can help me ?
Thanks.
p.s : i need to disable only the sub item without the root item.
|
|
|
|
|
|
I'm not sure if this is right board.... Does anyone know if there are problems using msscript.ocx in multithreaded environment? specificaly I'm using it from C++ COM object that is called from IIS. Each clients session has an object for processing some vbscripts. What I'm seeing is that if one client destroys the msscript object/ or even just calls "reset" on it another object of it on another thread dies as well. - cut right in a middle of a vb call
Please help!
"personal world record"
|
|
|
|
|
Hello all,
I recently took an internship (I'm a junior Computer Engineering major). I've had a lot asked of me, especially for an intern but have come out ok so far after many headaches. Now, I have come to something I just can't quite understand. We need to be able to digitize from a video capture card to an mpeg file. I've read through some stuff about DirectShow, which is what I am supposed to use, but can't quite get my mind around everything. Does anyone know of code or examples I can reference for something like this? Any help would be greatly appreciated!
Dave Wilson
|
|
|
|
|
If you haven't already, download the Platform SDK, which contains the DirectShow sdk...
Windows® Server 2003 SP1 Platform SDK Web Install[^]
The DirectShow base classes are handy (and recommended) for filter development and the sample
applications are pretty decent.
For MPEG encoding, there's no free codecs included except the Windows Media MPEG-4 encoder which
can be accessed using the WM ASF Writer Filter. For other flavors of MPEG you'll need a 3rd-party
codec or roll your own.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Don't use SYSTEM_FONT , that's still around only for compat with Win 3.1. There are many MS blog posts about the right font to use, start with this canned search[^].
|
|
|
|
|
found that DEFAULT_GUI_FONT goes the trik before seeing this post ,thanks anyway
-- modified at 16:50 Thursday 22nd March, 2007
|
|
|
|
|