|
Its a binary file. Reading it in Notepad, Wordpad, or any other text editor will show you lots of weird characters.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
You won't be able to read the file. It is in binary. If you want to look at it, open it up in a hex editor to verify its contents. Otherwise, write a method to read in the data in a similar fashion to the way it is written and then print it to the screen:
fstream fin("final.dat", ios::in | ios::binary);
while (!fin.eof())
{
rec r;
fin.read((char*)&r, sizeof(rec));
cout << r.name << "\t"
<< r.age << "\t"
<< r.wt <<endl;
}
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
i create a dialog based application
it consists of two from class
form1 and form2
i can display form1 like this
CDialog form1(IDD_FORM1)
form1.DoModal();
if i try to display form2 from
form1 by OnOK()method like this
CDialog form2(IDD_FORM2)
form2.DoModal();
IT IS NOT WORKING
HOW CAN I DO IT
janan
|
|
|
|
|
ningthemcha wrote: IT IS NOT WORKING
what happens ?
can you post the relevant parts of your code ?
|
|
|
|
|
See MSDN article Q138681.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I'm guessing that Form1 is your main dialog for your application? That being the case, when you click "OK", it ends up exiting the program. So even if you spawn another dialog, the main thread is exiting.
Use a different button, or don't call CDialog::OnOK in your OnOK handler ... or don't use Form1 for your main dialog.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Do you get error?if yes what if no whats happen?
|
|
|
|
|
i made a program using flexgrid ActiveX control and when i run and call a function from the flexgrid class i got a debug assertion failed mesaage
|
|
|
|
|
|
Use your debugger to see where your program crashes.
And if you want more chances to get an answer you have to provide a lot more informations (but still, use your debugger and if you are stuck, THEN post informations that comes from your debugger).
|
|
|
|
|
when calling msflexgrid::clear() for example the program fails in this line
ASSERT(m_pCtrlSite != NULL); in the vs/src/WINOCC.cpp file
|
|
|
|
|
Are you calling AfxEnableOleAutomation() or CoInitialize() in your InitInstance function?
Usually you get those types of assertions when you haven't initialized COM.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
how can i initialize COM? and what's the declaration for these two functions?
|
|
|
|
|
identity_85 wrote: how can i initialize COM?
By using one of the two functions that Zac mentioned.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: identity_85 wrote:
how can i initialize COM?
By using one of the two functions that Zac mentioned.
This is about the time where I would tell him to take his hands off the keyboard, go to Barnes and Noble, buy any Intro to C++ book and any Intro to COM book ... and not to touch the keyboard again until both have been read and understood ... *sigh*
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Zac Howland wrote: This is about the time where I would tell him to...go to Barnes and Noble...
Be sure to include directions.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
program fails cause in ASSERT(m_pCtrlSite != NULL); "m_pCtrlSite" not an OLE control ?? will these two functions solve it and if so what's the directions or classes of them plz?
|
|
|
|
|
identity_85 wrote: will these two functions solve it
Very doubtful. Had you failed to initialize COM, the application would have most likely failed to even start.
I created a dialog-based project and added the Microsoft FlexGrid v6 Control to it. I then added the control to the dialog template. At this point, I could compile and run the application fine. What else do you have in place?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Had you failed to initialize COM, the application would have most likely failed to even start.
It would have started, but as soon as any access to the control was made, it would have given an assertion (in debug) or just crashed (in release).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Zac Howland wrote: It would have started...
True, in a sense.
Zac Howland wrote: ...but as soon as any access to the control was made, it would have given an assertion (in debug) or just crashed (in release).
Neither of which happened. It just went away quietly.
|
|
|
|
|
Hi,
I'm trying to debug my code, and each time I run into a dynamically-linked function-call, the debugger cannot step-into the function, and does not stop at breakpoints inside it.
e.g.
class ISender {
public:
virtual void Send() = 0;
};
class XSender : public ISender {
...
virtual void Send();
};
ISender *m_sender = new XSender;
m_sender->Send()
Instead, it suggests that it shows the disassembly, as if it cannot find the matching code. I've tried that, and I still can't go inside these functions.
Static calls to functions of the same class work properly, e.g.
ISender m_sender = new XSender;
In addition, The debugger does not show the value of the object in the monitor, unless I specifically cast it to the run-time type of the object, i.e.:
(XSender *)m_sender
I suspect that thesse problems are related but I'm not sure.
Any ideas Thanks.
while (i == live) {
have(fun);
}
|
|
|
|
|
Just a quick thing to check; you say the code's dynamically-linked (ie in a DLL); check the output pane of Visual Studio for the line that loads the DLL the call's in. It should say something like:
'StyleManager.exe': Loaded 'C:\Codebase\codedb\PF\Products\StyleManager\SMCmdLine\Debug\StyleManager.dll', Symbols loaded.
If it doesn't say 'Symbols loaded' for your DLL (instead it'll say 'No symbols loaded.'), then the debugger won't know how to debug into the DLL (other than in assembly view). You'll need to ensure that the DLL is built in debug mode and that the relevant PDB is around. Most of the time this happens automatically, but if you have a custom post-build step that copies the DLL somewhere else but not the PDB then you might get this kind of problem.
|
|
|
|
|
I have two bitmaps (loaded from resources).
I want to combine thse two bitmaps side-by-side into a 3rd bitmap.
I want to put the 3rd (combined) bitmap into an image list.
I tried using the BitmapDC class from the GDI articles section, but I'm missing something (obviously, otherwise I wouldn't be here).
Here's the code I'm using now:
CBitmap bmp1;
CBitmap bmp2;
bmp1.LoadBitmap(nImgConsult);
bmp2.LoadBitmap(nImgLabs);
CBitmapDC bmpDC(34, 21, GetDC(), RGB(255,255,255));
DrawBitmap(&bmp1, &bmpDC, CPoint(0, 0));
DrawBitmap(&bmp2, &bmpDC, CPoint(17, 0));
CBitmap* pBMP = bmpDC.Close();
if (!m_ResultsImages.Replace(0, pBMP, NULL))
{
TRACE("ImageList.Replace failed\n");
}
delete pBMP;
Any hints, clues, or alternative code?
-- modified at 11:36 Wednesday 26th July, 2006
|
|
|
|
|
Why not just use the GetBitmapBits/SetBitmapBits (and CGdiObject::GetObject) to get the bits from images 1 and 2, create a byte array that is the size of the sum of both those arrays (which should be double the size of either one if the bitmaps are the same size), copy the bytes from image 1 to the first part of the new array, and image 2 to the last part of the new array and then use SetBitmapBits on a newly created CBitmap object?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
another approach is create a bitmap sized to fit both source bitmaps. arrange the bitmaps via bitblt()
Kuphryn
|
|
|
|