|
jimNLX wrote:
These are local to their files
but linker puts these files together
|
|
|
|
|
Make them static to force internal linkage.
eg:
-- func.cpp --
static int x; // internal linkage, global to func.cpp only
-- func1.cpp --
static int x; // internal linkage, global to func1.cpp only
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
&Hi,
How can i decode dtmf signals from telephone line? TAPI doesn't meet my requirements, there're circuits that decodes dtmf signals but i want to implement it on PC with software.
|
|
|
|
|
|
I recently reinstalled windows and Visual Studio 6. I almost forgot how fiddly it is to install all the SDK updates and all that. Now i finally managed to get it all i think but now when i try to compile any of my projects i get the following error:
c:\program files\microsoft visual studio\vc98\include\oleidl.h(5059) : fatal error C1021: invalid preprocessor command 'end'
Does anyone know how to fix this
Btw, the SDK update program installed the Windows 2003 server SDK and i'm running Windows 2000 professional (even though i don't think this has anything to do with it cause the include file is not in the updated SDK directory).
Kuniva
--------------------------------------------
|
|
|
|
|
You can probably just open up oleidl.h and replace #end with #endif, like maybe oleidl.h got corrupted somehow. Or if that solution worries you, just reinstall VC6 again.
Chris Richardson
|
|
|
|
|
Anyone know of a JAXB package that spits out C++? I'm looking for an alternative to manual development of C++ classes from an XML schema.
I've found one on SourceForge but it doesn't seem to be mature. I was wondering if anyone knew of an Apache or IBM/AlphaWorks C++ implementation.
Thanks!
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi, this is my first post on the forum, my name's Florian and I'm from Switzerland (where they make the cheese
Right now I'm beginning DDraw with c++ (where I'm still quite a beginner too), and I have started writing a DDraw class, a wrapper of a sort, to facilitate casual operations. One of the member functions is a function wich takes a LPDIRECTDRAWSURFACE7 as a parameter and should create a offscreen surface & point to it with the given LPDIRECTDRAWSURFACE7. But somehow it doesn't work, because when I check the pointer after having used the function, he's always invalid.
Here's the code:
<br />
<br />
ENUM_RESULT CDDraw::CreateOffscreen(int iWidth, int iHeight, bool bKey, LPDIRECTDRAWSURFACE7 lpSurface, int iMemFlags)<br />
{<br />
memset(&itsDdsd,0,sizeof(itsDdsd) );<br />
itsDdsd.dwSize = sizeof(itsDdsd);<br />
<br />
if(!bKey)<br />
itsDdsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;<br />
<br />
else<br />
{<br />
itsDdsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CKSRCBLT;<br />
<br />
itsDdsd.ddckCKSrcBlt.dwColorSpaceLowValue = itsTransColor;<br />
itsDdsd.ddckCKSrcBlt.dwColorSpaceHighValue = itsTransColor;<br />
}<br />
<br />
itsDdsd.dwWidth = iWidth;<br />
itsDdsd.dwHeight = iHeight;<br />
<br />
itsDdsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | iMemFlags;<br />
<br />
if(lpSurface)<br />
{<br />
lpSurface->Release();<br />
lpSurface = NULL;<br />
}<br />
<br />
if(FAILED(itsLpDD->CreateSurface(&itsDdsd, &lpSurface, NULL) ) )<br />
{<br />
return(VID_ERR_CREATEOFFSCREEN);<br />
}<br />
<br />
return(OK);<br />
}<br />
All the "its*" variables are class variables (of CDDraw), and I try to create the offscreen surface in another class, CMain, wich contains an instance of CDDraw ("itsVideo"), and a LP to a DD surface, "itsSprite". What I try to do looks like this:
<br />
itsVideo.SetColorKey(255,0,255);<br />
<br />
if ( (itsResult = itsVideo.CreateOffscreen( <br />
64,64,true,itsLpSprite) ) != OK)<br />
{ <br />
itsError.ShowMessage(itsWin.GetHwnd(), itsResult);<br />
}<br />
<br />
if(!itsLpSprite)<br />
{ <br />
itsError.ShowMessage(itsWin.GetHwnd(), itsResult);<br />
}<br />
And each time, I get an invalid surface...
Any advice/criticism (I'm sure there's alot to critic is welcome...
|
|
|
|
|
i'm trying to convert a string to a double without losing precision. for example, let's say you a string "0.070" and i want it to convert to double. so, i pass it into atof() and i get a double with a value of 0.069999999. how can i get the double to be 0.070? i tried to round the result of atof() to the number of decimal places, but that didn't help. anyone have any ideas?
thanks.
|
|
|
|
|
Some numbers just won't convert, it's to do with representing them in binary rather than decimal. That's why they're described as 'floating' point numbers, or double precision f.p. numbers. Doubles aren't any more precise, but they can accomodate a larger working range.
If you can handle a fixed number of decimal places, you might want to use large integers instead (__int64) with a fixed divisor, like 1000, but this obviously depends on what range you're dealing with. The OLE CURRENCY type does something along these lines.
Steve S
|
|
|
|
|
hello, i have writen a winsock aplication using visual c++. i have wrote a new non mfc class to handle a recv thread in my program. the problem is i need to access some of the varibles from my original mfc class,the varible i need to write to is a static text CString.
the varible was declared with the class wizard wich aut:-Domaticaly assighned a varible to the static text id.
is there a way i can access this varible from my new non mfc class,or would i have to declare the CString as global?
if so how would i go about this?
thankyou in advance
chris
|
|
|
|
|
Are you wanting read access (in which case you could just use an LPCTSTR), or write access? If the latter, then you've just put in a dependency on MFC in your shiny new class...
Steve S
|
|
|
|
|
Steve S wrote:
If the latter, then you've just put in a dependency on MFC in your shiny new class...
Couldn't CString::GetBuffer() be used to "pass" the buffer to the other thread?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
[fx:blush]
Yes, of course it could.
Steve S
|
|
|
|
|
hmmm well its definatley the latter,im trying to update the string with new information obtained from my server,but becouse im stuck in my "shiney new thread class" i cant seem to write from my inBuffer wich is in my thread class to my varible..
this is very annoying coz i cant use functions like UpdateData(); from my new class either.
thank you for your speedy response & any further help would be much appreciated.
thanks again
chris
|
|
|
|
|
Sounds like you have a CString in your dialog class which is being used by DDX_Text. If you want to update the data, you could use SetWindowText instead, which means you'd need the window handle for edit control instead of the CString.
Steve S
|
|
|
|
|
hahah thank you very much,i have sorted my problem now!
cheerz m8;)
chris
|
|
|
|
|
Hi,
One of my beta testers told me about preparing a build with debug statements being logged in a text file. I'm trying to find a fix for a bug with Exchange Server that I cannot reproduce and I guess that being able to see in a file what happened would be tremendously useful.
I do not, however, know anything about that sort of thing... Anyone can help me out?
Thanks!
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
An alternative that requires almost no work is to use OutputDebugString to write stuff to the debug window. MFC has TRACE() which does the same, but does nothing in Release builds. OutputDebugString will generate output in all cases.
The next step is to go to the sysinternals web site[^], and get hold of DebugView.
You can run this tool on any windows machine and it lets you catch and save to file the debug output, not just for a single app, but on a system wide basis.
I use it to examine some of the trace output from our COM+ server apps.
Steve S
|
|
|
|
|
You can consider placing ASSERT condition or VERIFY condition in your codes if you haven't. There are many articles on this topic in codeproject.
ASSERT is only available in debug mode. VERIFY however is in both cases.
Many bugs can be spotted by having ASSERTS around.
hope this helps
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I did place ASSERTs everywhere in the code but I wanted something that could be saved as a file. In that case, it was an infinite loop so the ASSERTs would have been useless but they are useful in some other cases...
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
not much on google for this one...
I'd like to remove the doc/view from our application, no real need for it.
anyway.
if I do something like :
{ ...
CreateNewChild( RUNTIME_CLASS( MyOtherFrame ), IDR_BIGTESTYPE, ::LoadMenu(hInst, MAKEINTRESOURCE(IDR_BIGTESTYPE)), ::LoadAccelerators(hInst, MAKEINTRESOURCE(IDR_BIGTESTYPE) ) );
...}
when opening a new window, and doing this for other frame class, it's working fine; I don't keep the returned value from CreateNewChild since the frame and the data gets deleted
Is there's a way to iterate the framewnd to close them ? other than iterate the child windows and closing them manually. for example if I want to do a close all window, or close document.
Thanks.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
What I've done before now is that the CMainFrame class maintains a CArray<> of CFrameWnd pointers which are children, and the OnCreate()/OnDestroy() handlers for the child frame post messages to the main frame window to register/unregister themselves...
Steve S
|
|
|
|
|
say that again ? that you kept an array on CFrameWnd or that the CMainFrame(CMDIFrameWnd) already keeps it ?
thanks.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
In CMainFrame I had an array of CFrameWnd*, which was updated on receipt of a user defined message. The user defined message was posted when my child frames were created or destroyed. Saves iterating through via EnumChildWindows, as it only encounters child frames, not things like toolbars and the like.
Steve S
|
|
|
|