|
DavidCrow wrote: dt->data = (CREATESTRUCT *) new CREATESTRUCT;
Any particular reason for the explicit cast?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Richard Andrew x64 wrote: Any particular reason for the explicit cast?
Yes. I had not typed enough this morning and was simply trying to meet my quota.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Cold_Fearing_Bird wrote: I new/malloc blocks
Are you sayiny you can't even tell what method you used to allocate memory? In that case you must make sure that you are calling the proper destruction method, i. e. either free() or delete (or, maybe delete [] ?). I fyou don't take care of that and use the wrong method, your program will crash at runtime.
Wherever you get the pointer from, you must add a release() method there that takes care of the proper destruction and deallocation. This most probably will involve virtual destructors in case of classes, or some other method of indirection.
|
|
|
|
|
no
does that even compile?
|
|
|
|
|
it does compiles on VS2008.
Watched code never compiles.
|
|
|
|
|
Hi all,
I have one parent dialog where in OnPaint Function i am drawing some rectangles.
On that dialog i am opening one more child dialog,
I am making that child dialog as modeless,so that i can move that dialog
I want to keep the modless dialog active even when i click on the parent dialog,so that i can move rectangles.
OnLButtonDown i need to redraw the rectangles and even keep the dialog visible.
But when i click the Mouse LButtonDown,my child dialog is getting dissappeared
void Test::OnLButtonDown(UINT nFlags, CPoint point)
{
CRect rcClient(170,414,170,415);
LeafDialog::GetClientRect(&rcClient);
if((xp<415 && xp >140) && (yp>100))
{
InvalidateRect(rcClient,false);
LeafB[0]=100;
LaefA[0] = 100;
}
}
On Test View i am creating dialog
void CTestView::OnLoadImage()
{
CBitmapimage* dlgbmp;
dlgbmp = new CBitmapimage;
dlgbmp->Create(IDD_DIALOG1,this);
dlgbmp->ShowWindow(SW_SHOW);
}
Can anyone tell me what can i do so that even i can move the image and redraw on the parent dialog when clicked on the rectangle
Thanks
Sharan
|
|
|
|
|
It sounds like the modless child dialog needs to have the HWND_TOPMOST position in the tab order so it never gets to go behind its parent window.
See the SetWindowPos function for details. You may have to be careful in its use as the modless window should not sit in top most mode when you application does not have focus.
If you vote me down, my score will only get lower
|
|
|
|
|
"UnitTest" is on the VC's main menu,I want to use itto test my C++ code, but I am not familiar with its mechanism.
I wrote a little code expecting to learn how it works.But seems not work.
here's my code
class myClass
{
private:
int m_i ;
public:
myClass( int i ):m_i(i){ }
BOOL EQ( int i )
{
if( m_i == i )
return TRUE ;
else
return FALSE ;
}
} ;
int main()
{
myClass mc( 10 ) ;
}
I click "new UnitTest", go through a few steps,when trying click the checkbox besides my project name, there's always a msg reporting unsuccessful "Unknown virtual address 0".
Waiting for help...
modified on Thursday, July 21, 2011 5:09 AM
|
|
|
|
|
I haven't used the tool myself, but isn't there a startup guide to make us understanding the procedure to be followed.
Also, you can refer the articles on MSDN and I sure you will find more than one that will guide you further.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
Certainly good advice, but I have to say it may not be easy to find useful material: I've faced almost the same problem, and my searches turned up tons of Tools for Unit-Testing or Tutorials for using such tools, but virtually nothing about how to set up a unit test in the first place!
Maybe an explicit search at specific sites such as MSDN or various technical forums might help - I haven't tried that yet.
|
|
|
|
|
Yeah, I searched lot, still haven't found too much helpful materials.I think I should give up using it since it related tightly with netFramework.Someone says C++ test is one of the best UnitTest tool, I'll have a try.
|
|
|
|
|
Indeed. I've been spending the last hour to find something more useful, and have all but given up. At the moment I'm digesting the entries on Unit testing that I've found on Wikipedia, just to be make sure I fully understand the concepts. Maybe that's a good place for you to look too?
Unit Testing - Wikipedia
|
|
|
|
|
Thanks, Stefan. I'll take a look.I love Wiki too. It was the place that taught me how to do the matrix multiplication.Hoho
|
|
|
|
|
This might help: Unit-Testing Native C++ with Visual Studio[^]
By using the Unit Testing framework in Visual Studio, then you should automatically get the ability to see code coverage (Though it requires one of the expensive Visual Studio Editions)
|
|
|
|
|
Hi all,
i am using a droplist type combobox.i am inserted some strings in this combobox,but some long strings in combobox not fully visible.
it there any method to make visible these strings.
thanks in advance.
|
|
|
|
|
|
|
|
Hello to all,
I have written a VC++(MFC) application in which one of our USB connectivity device gets connected to computer and I continuously collect the data from that device. I display that data on screen and also when I give print command to printer through my application then that data gets printed on paper.
Now my problem is that, when I give print command to printer then it interrupts or stops data collection from the device untill the printing process gets completed but due to this we loose data from the device. So is there any way to handle printing process independently? Means can we give print command to printer using "PostMessage" or using seperate thread so that it will not stop data collection from device? or is there any other way to do this?
This is really very very urgent so please please help me out.
Thanks and Regards
Anay
|
|
|
|
|
I would suggest using threads or even a separate program to do the printing. A lot depends on where you are storing the data that you are collecting.
The best things in life are not things.
|
|
|
|
|
How to get the title text CTabCtrl's tabs?
The following code is crashing at the last line:
TCITEM tcItem;<br />
tcItem.mask = TCIF_TEXT;<br />
m_ReportTabCtrl.GetItem(ID_PANE_FOUND, &tcItem);<br />
CString csText = tcItem.pszText;<br />
Thanks & Regards
--
"Programming is an art that fights back!"
|
|
|
|
|
You did not initialise your TCITEM structure properly; see the MSDN documentation here[^]. It would be better to check the return value from all Windows function calls rather than just assuming that they have succeeded.
The best things in life are not things.
|
|
|
|
|
Thanks, It is working after initializing all the required members tcItem.pszText and tcItem.cchTextMax along with tcItem.mask.
--
"Programming is an art that fights back!"
|
|
|
|
|
I have a relativ simple (SDI) VC6 project that, because system tray notification ( showing ballon ) I have to compile in a newly environment ... I choose VS2008. I prefer to compile in a dynamic MFC library but I front with several linking errors :
error LNK2005: __invoke_watson already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: __encode_pointer already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: __decode_pointer already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: __configthreadlocale already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: __amsg_exit already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: __initterm_e already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: _exit already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: __exit already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: __cexit already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: __unlock already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: __lock already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj) libcmt.lib Der
error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj) libcmt.lib Der
error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj) libcmt.lib Der
error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj) libcmt.lib Der
error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: ___set_app_type already defined in msvcrtd.lib(MSVCR90D.dll) libcmt.lib Der
error LNK2005: __setmbcp already defined in libcmt.lib(mbctype.obj) msvcrtd.lib Der
fatal error CVT1100: duplicate resource. type:MANIFEST, name:1, language:0x0409 CVTRES Der
fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt Der Der
I never used VS2008, what should I do to solve the problem ?
|
|
|
|
|
I got similar errors when moving from 2003 to 2010 recently. The cause was a static library that was part of my project that bound the runtime library statically rather than dynamically. For some reason this was never a problem before, but VS 2010 didn't like it.
My advice is check the libs that are part of your solution and make sure they all use the same settings regarding the runtime library being used. note that it doesn't matter whether the lib is bound statically or dynamically to your executable - the main point is that all libs must use the same version of the runtime library. (and I believe the same is true for the choice of MFC library)
|
|
|
|