|
Thanks. I tried cleaning and then rebuilding but I still get the same error.
|
|
|
|
|
Hello,
Your problem is clear! You should separate the definition of functions from the declaration. The definition (aka implementation) should be in a compilation unit (*.cpp file) the declaration should be in the header file.
if you separate those, you should have no problem.
I also got the blogging virus..[^]
|
|
|
|
|
Thanks, that worked. So, if I have the declaration in the header file but the implementation in the cpp file, then any file that includes the header file should be able to see the function?
--
Marcus Kwok
|
|
|
|
|
The problem was that your #ifdefs only protect against the header being included multiple times from the same source file. Since it is being included multiple places in your project, std::ostream& operator<< is getting defined multiple places, and therefore compiled into many different .OBJ files. The linker does not like this when it tries to tie it all together.
When you separate the header and implementation, the CPP file with the function definition gets compiled only once, so the linker is happy.
|
|
|
|
|
ricecake wrote:
So, if I have the declaration in the header file but the implementation in the cpp file, then any file that includes the header file should be able to see the function?
Yep.
When you declare something in the *.cpp file, it has internal linkage. This means that only the code after the declarating is able to see this. When you put the declaration in the *.h file, you give it external linkage. This means that all your code is able to use it as long as the header file is included.
I also got the blogging virus..[^]
|
|
|
|
|
Hi, I'm trying to allocate memory in DOS using Borland Turbo C.
I need about 1MB but the system only gives me 64Kb.
does anybody know how can I change the memory model to get more memory?
thanks in advance.
Daniel Cespedes
"There are 10 types of people, those who understand binary and those who do not"
"Santa Cruz de la Sierra Paraiso Terrenal!"
daniel.cespedes@ieee.org
|
|
|
|
|
if i remember correctly, you have to choose different memory model. "small" supports only 64kb for stack and 64kb for data. try choosing 'compact' (64kb code, 64 kb static data and stack, 1 Mb heap) or 'large' (like 'compact', but 1Mb for code).
you can change this from 'options' menu: Options -> compiler -> model.
you can read more about this in Turbo C online help.
|
|
|
|
|
Turbo C is a 16-bit compiler. I do not know of an answer but try using the large or huge memory model.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Let's do the time warp again!
(danananananana)
Anyway.
You need to use XMS or EMS or some other DOS memory extender if you want to go beyond 640K. Thankfully (for me, not you) I never did any heavy duty DOS programming. Even staying within the lower 640K was a nightmare I don't ever want to repeat.
So unless there are fancier tools available now, do some googling on expanded or extended memory. DOS/4GW was one too, I think? Several games used that IIRC.
|
|
|
|
|
Hello,
I want to catch Keyboard events of MS-Word in my MFC application without any global hooking or subclassing. Is there any other way to catch these events without the above-mentioned techniques?
Regards
Noman
|
|
|
|
|
Can someone help me, please.
I am using DOM xml parser and I have to read
node attribute. There is no problem but
when attribute has some spaces inside
i get string without it.
for example:
XML node has arrtibute: <song id=" 125 ">
and i obtaind string "125"
..spaces are trimed
And I need these spaces as well
I there any DOM parameter or way how to set "don't trim"
Thank you
viliam
|
|
|
|
|
I add CToolBar to a dialog box easily but the bar's tooltip does not show when mouse moves over its butons.
do u have solution for this?
thx
includeh10
|
|
|
|
|
Hello,
I have seen your's reference on code project. I am new to CHM format and i need to
create a CHM viewer. I have some queries regarding the same
a) what is binary TOC and binary index ( I have been able to parse the HHc and HHk fie). How i should parse the same
b) What are merged files. How i can read them
c) How how CHI, CHw and CHQ files can be created. How reading of these files will be different form the reading CHM file.
Please help me out by answering my queries.
Thanks,
Ritu
|
|
|
|
|
|
Perhaps http://66.93.236.84/~jedwin/projects/chmlib/
--
Joel Lucsy
|
|
|
|
|
I have problem with ATL COM exe
First I build the exe in Win32UnicodeReleaseMinDependancy settings , seems to be allocating 13324 k virtual memory (VM) at startup and then it allocates 1.8 GB which grows up to 1.9 GB of VM
but at the same time exe build in Win32UnicodeDebug settings allocates only 1160 k at startup and allocates 1672k VM , which increases slowly
Can Any one suggest me why exe build in
Win32UnicodeReleaseMinDependancy allocates 1.9 Gb virtual memory .
|
|
|
|
|
Bugs in your software. Look for uninitialized variables.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I have problem with ATL COM exe
First I build the exe in Win32UnicodeReleaseMinDependancy settings , seems to be allocating 13324 k virtual memory (VM) at startup and then it allocates 1.8 GB which grows up to 1.9 GB of VM
but at the same time exe build in Win32UnicodeDebug settings allocates only 1160 k at startup and allocates 1672k VM , which increases slowly
Previous version of the same exe is working properly (allocating less amount of virtual memory ) and I compared all the project setting of new exe with older one both are same
Can Any one suggest me why exe build in
Win32UnicodeReleaseMinDependancy allocates 1.9 Gb virtual memory .
|
|
|
|
|
when SDI/MDI applications generated by VC are run; they have one instace of child view by default, how can we have an SDI/MDI which is blank initially and child views are generated on demand only.
|
|
|
|
|
Is MSDN article Q141725 of any help?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks a lot
|
|
|
|
|
I tried Sleep(1) but it looks like win xp and win 2000 wait for 10 ms instead.
I could be wrong but if I do Sleep(10) then delay between characters I am sending exactly as with Sleep(1). I am not a Windows programmer, I am specialising in embedded real-time and particular in Unix systems and I know that often default kernel time resolution is 10 ms (eg. linux).
What resolution windows Xp, 2000, 95, 98 have? Are they the same? What the best way to sleep for 1 ms?
Thank you
|
|
|
|
|
Hello,
write your own delay routine using high-resolution APIs, QueeryPerformaceCounter() and QueeryPerformaceFrequency(.
you can achieve timer even in microseconds.
hope the above helps.
regards,
Adi
|
|
|
|
|
getting a precise value in the microsecond range in windows is practically not possible ,taking into account that it handles many task at a time,since windows aint an real time os.....aint it?????
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
When the process and thread priority is at realtime level windows is almost like a real-time os.
(not in timing, but you can implement a wait timer yourself by creating a loop and comparing the time differences!!!)
Don't try it, just do it!
|
|
|
|