|
you need to provide the entire definition of the template, in order to 'export' it. a template is not a class - it's just a recipe that the compiler uses to make a real class. any compiler using your lib will need the whole template definition to build that class.
this[^] might help.
Cleek | Image Toolkits | Thumbnail maker
-- modified at 16:50 Friday 9th September, 2005
|
|
|
|
|
thanks for the link. so, there is no way to export the actual template, so that clients can recreate the templates with any types they need? What i am basically looking for is a way to reuse class templates in multiple projects. any suggestions?
|
|
|
|
|
|
thanks, that link explains why it doesn't work. so, tbe answer is no? oh well, i'll figure something out
|
|
|
|
|
zildjohn01 wrote:
so, there is no way to export the actual template, so that clients can recreate the templates with any types they need?
put the template in a .H file and let anyone who wants to use your template #include that .H file.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
good afternoon,
The memory leak report looks like this:
{404} normal block at 0x00FD8CD8, 49995 bytes long.
Data: < > 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
{399} normal block at 0x00FD8770, 1309 bytes long.
Data: 48 65 61 64 65 72 20 4C 65 6E 67 74 68 3A 20 30
{166} normal block at 0x00FBDAC0, 14844 bytes long.
Data: <5 a p > 35 00 00 00 90 D2 61 00 70 81 13 00 00 00 00 00
c:\dev\c++\billing\voldisc\voldiscdlg.cpp(592) : {147} normal block at 0x00E25028, 64 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
the Last part with all CDCDCDCDCDC seem like unintinized object, but it looks alright in the code,
DiscountData = new DISCOUNTDATASTRUC;
what about all the 20202020202020, it has 49995 bytes long.......is it the leak size? this application works, but it has all the memory leak..
thanks.
|
|
|
|
|
valerie99 wrote:
the Last part with all CDCDCDCDCDC seem like unintinized object,
Right, it is an uninitialized object and is used for debugging purposes. You can see it, and others, in dbgheap.c . Initialize all of your pointers to NULL .
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
thanks for your reply,
"it is an uninitialized object and is used for debugging purposes", do you mean this should not effect the release version of the program? it seems like stop and didn't create the report when I ran debug version ....
|
|
|
|
|
valerie99 wrote:
The memory leak report looks like this:
{404} normal block at 0x00FD8CD8, 49995 bytes long.
If you can run the program in the same exact way, you can put this:
_CrtSetBreakAlloc(404);
in the beginning of the program (where 404 is the number in brackets above) to get the program to break when it allocates the memory that doesn't get freed. I put mine at the beginning of my app's InitInstance. That might tell you something; I've found it to be a very useful tool. But like I said, it needs to be run in the exact same way so that the number doesn't change.
|
|
|
|
|
thanks for the command, I have tried this tip on my APP's InitInstance, it stop at the DBGHEAP.C, when I look at the call stack, it hit this part of code int nResponse = dlg.DoModal();, and the least are MFC stuff......couldn't really tell where it cause the problem
it brought up another question, all the numbers inside {}, some of them are connected next by each other, like 191, 192, 193, is it means one uninitized pointer causing couple crashes or something like that? I don't really know how to read this. thanks again!
|
|
|
|
|
|
valerie99 wrote:
c:\dev\c++\billing\voldisc\voldiscdlg.cpp(592)
You are calling new on this line, and there is no matching delete to match it.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
that works!
more question ......what about this :
{435} client block at 0x00FC27A8, subtype 0, 28 bytes long.
a CPtrList object at $00FC27A8, 28 bytes long
{434} normal block at 0x00FD8400, 40 bytes long.
Data: <binaryfield> 42 69 6E 61 72 79 46 69 65 6C 64 00 00 00 00 00
c:\dev\c++\billing\voldisc\voldiscdlg.cpp(1169) : {433} normal block at 0x00FD8158, 612 bytes long.
Data: < a P W > DC AE 61 00 50 8B FD 00 57 04 00 00 0C 00 00 00
and the 202020202020.......thank you and have a greatweekend!
|
|
|
|
|
Just double click on the "c:\dev\c++\billing\voldisc\voldiscdlg.cpp(1169)" line and it will take you to the leaky object.
He is smart. He will make our Windows go.
|
|
|
|
|
Hello gurus,
I'm currently rewriting a 20 years old 2D game. The game I rewrite is BubbleBobble for the TI-68K platform in standard C (C99). I ask my questions on this forum because it might interest other people and I don't know where to find the answers.
I would like to know where I can get information about old fashion 2D games programming for the following things:
- Physics of sprites:
* Jumping of sprites with detection of elements of the map (player, ennemies and bosses)
* Collision detection between sprites of different natures and sizes (player/ennemy/bubbles)
* Collision detection with the elements of the map (mainly walls)
- AI:
* Tracking algorithms with path-finding: that is ennemies follows the player and avoid obstacles when encounting them
* sentinel movements
Thanks in advance for the help.
Best regards.
There is no spoon.
|
|
|
|
|
you have to make a sprite manager for sprite collision, etc...
buy a book something like Game programming in 24h or lesson it`s a good book of 2D game programming
|
|
|
|
|
There are lots of game programming sights on the net that have tons of code for doing every thing you are looking for.
Some good keywords to search for: Graphics, Gems.
"Graphics Gems" are a series of books on graphics algorithms, and the code is online.
There's also another series of books with "Gems" in the title that covers: graphics, AI, collision detection, sprite management, ect...
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi,
I am using Matlab C++ Math library in my codes. I want to use randn("state",0) to reset the state of the generator. But when I run the program, I got run time error, unhandled execption.
Is there anyone who can help me?
Thanks a lot
Chenyu
|
|
|
|
|
Hello everyone.
Is it possible to make a MFC application using MySql as the source database in .Net enviroment to run in a computer which isn't installed .net runtime?
If the answer is yes, could anybody tell me how to do it please? And also how to connect with mysql database in a MFC application please?
Thanks in advance
Asura
|
|
|
|
|
Ming Luo wrote:
Is it possible to make a MFC application using MySql as the source database in .Net enviroment to run in a computer which isn't installed .net runtime?
Yes, you just wouldn't be able to test it effectively.
Ming Luo wrote:
If the answer is yes, could anybody tell me how to do it please? And also how to connect with mysql database in a MFC application please?
Create a DSN and then look at the MFC classes CRecordset and CDatabase , or the ODBC API if you are not using MFC.
|
|
|
|
|
DavidCrow wrote:
Ming Luo wrote:
Is it possible to make a MFC application using MySql as the source database in .Net enviroment to run in a computer which isn't installed .net runtime?
DavidCrow wrote:
Yes, you just wouldn't be able to test it effectively.
I am a quite new C++ learner. Could you tell me how to make it please??
Asura
|
|
|
|
|
I'm trying to set up info tips for different subitems in a CListView in Report mode. I can catch the LVN_GETINFOTIP when you hover over subitem 0, and correctly display the text I want. But hovering over any other subitem doesn't produce the notify. It would seem that the method CListView::SetInfoTip might do what I want, but it fails (returns false) when I invoke it, and I have no idea why.
I have an application manifest, and I am using version 6 of ComClt32.dll. I've set the extended style to include LVS_EX_INFOTIP.
I'd like to get this API working. Alternatively, if there's some way to get the LVN_GETINFOTIP notify when hovering over a different sub-item, that would do it too.
thanks,
Stache
|
|
|
|
|
The docs say that LVN_GETINFOTIP is only generated for the first item.
As for SetInfoTip, make sure that you are using a wide string. I had the same problem only to find out later that I was passing a ANSI string when it expected a wide string.
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
|
|
|
|
|
Ok, I think I've done all the manifest stuff correctly. DLLGetVersion on "comctl32.dll" reports Major Version 6, Minor Version 0, Build 2900, Platform 2.
Here's the actual code fragment, since at this point, I think I must be missing something blindingly obvious:
LVSETINFOTIP sit;<br />
sit.cbSize = sizeof( sit );<br />
sit.dwFlags = 0;<br />
sit.iItem = 1;<br />
sit.iSubItem = 1;<br />
sit.pszText = L"fake primary info tip";<br />
<br />
CString str = m_ListCtrl.GetItemText( 1, 1 );<br />
<br />
BOOL bResult = m_ListCtrl.SetInfoTip( & sit );
The extended style includes LVS_EX_INFOTIP and LVS_EX_LABELTIP, and I've tried either, both or none with no difference in results.
Any insight would be greatly appreciated!
thanks,
Stache
|
|
|
|
|
Hi I need to write a small console application that goes through all the entries and appends a character to the caption of every resource id string. Does anyone have some sort of example that could be useful or anything else that could help me get started?? Libraries I should use to read a an etry from a table might help. ok thanks
newbie0415
|
|
|
|