|
i heard some kind of solutions like
#if
#define
OR
using extern
just want to know whether they are possible in my case or not!
thanks!
jim
|
|
|
|
|
There could be cases (that I am not aware of) where you can use #if and #define but these preprocessor directives are used with constants.
"The extern keyword declares a variable or function and specifies that it has external linkage (its name is visible from files other than the one in which it's defined). When modifying a variable, extern specifies that the variable has static duration (it is allocated when the program begins and deallocated when the program ends). The variable or function may be defined in another source file, or later in the same file...(MSDN)". (You are not declaring variables or functions. You are defining classes.)
All you are doing in your code is making the compiler believe that the class exists, and then later you define that class somewhere else. There is nothing wrong with that and again as Ryan said that is the only solution. What you are doing is perfectly acceptable.
// Afterall, I realized that even my comment lines have bugs
|
|
|
|
|
Hi,
Can I save a video recording to a file and at the same time playback the file?
Can this be done using DirectShow?
Anyone tried this b4?
|
|
|
|
|
It can be done.
Try using an Infinite Tee filter to send streams to multiple renderers. It's worth prototyping the exact layout of the filters in GraphEdit to check that everything is going to work before you start coding.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Does anyone know of a function that will take 2 strings and show you the differences between them? Example:
"It takes a big man to cry, but it takes a bigger man to laugh at that man."
compared to
"It takes a large man to cry, but it takes an even larger man to laugh at that man."
would output something like
"It takes a -[big]- man to cry, but it takes -[a bigger]- man to laugh at that man."
I just don't want to reinvent the wheel here if there is something already tested and proven out there.
Thanks,
Jack
There are 10 types of people in this world, those that understand binary and those who don't.
|
|
|
|
|
I am new to this, so excuse me if I sound ignorant ...
How can DSR signal be asserted/deasserted on serial port programmatically using Win32 API's? I know that EscapeCommFunction() can be used to assert/deassert DTR... Does asserting DTR implicitly deassert DSR? Is this how DSR state is toggled?
Thanks,
Ruchika
|
|
|
|
|
RuchikaDhingra wrote:
How can DSR signal be asserted/deasserted on serial port programmatically using Win32 API's?
You can't. DSR and CTS are controlled by the device attached to the COM port. The PC has no control over them at all. You can only control the state of DTR and RTS.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi all,
I am having some troubles. I need to preview or print a pregenerated report
in ACCESS2002 directly from out of a VC++ program (using Visual developer 6.0).
Does anybody have a clue how to accomplish this astonishing feat ??
thx !
|
|
|
|
|
OLE Automation.
onwards and upwards...
|
|
|
|
|
OLE Automation,.. can you give a clue on which component i need to install then ? If i look in the active x addable components, i don't find any "ole automation" component, Just an OleInstall class component..
Thx for the reply by the way! much appreciated..
|
|
|
|
|
When I draw text in DirectX using DrawText, capital W's at the left edge of the text have the upper left pixels mysteriously cropped off. Has anyone else encountered this, who knows of a fix? I'm at Wit's End.
Dave Goodman
dgoodman@infoway.com
www.dkgoodman.com
"Actio sequitur esse."
|
|
|
|
|
Is this with ID3DXFont or CD3DFont (or something based on it)? I've seen this problem with ID3DXFont; it seems that when it draws the text using certain fonts, the kerning bumps the W just out of the texture. Try inserting a space before the W maybe?
I'm using a custom derivative of CD3DFont that decouples the font texture from the renderer, and lets me fiddle with the U,V coords for the characters (and "bake in" stuff like drop shadows). It's not as convenient as ID3DXFont and doesn't support Unicode, but it's a lot more flexible for playing with
- Mike
|
|
|
|
|
This will probably be an easy question for most people, but I'm still somewhat new using the visual studios, and I haven't had much luck researching scrollbars. I am not trying to use a scrollbar to control my main dialog, which is what most articles refer to. I am trying to put a scroll bar in the middle of a dialog that will manipulate a separate control. Basically, I don't know how to wire up my scroll bar after I've added it to my dialog, and there isn't an easy way to add a message handler. If this is just a message map solution, could you please show me a small example with your answer? Thanks a ton!! ;)
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
Handle WM_VSCROLL or WM_HSCROLL, depending on which direction your scroll bar goes. The last parameter has a pointer to the scroll bar that is sending the message.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Any tools out there for simplifying touch screen application development. Specifically, an onscreen keyboard which is "attached" to an existing CEdit control would be great. Otherwise, I'll have to roll my own.
Thanks!
|
|
|
|
|
Hi,
When you create a splitter window there are some bars between the views. You can use there bars to redimension the views. Is there a way to hide these bars? So that the views will appear as one single view...
Thanks
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
Derive your own class from CSplitterWnd, then override the OnDrawSplitter function. Look in winsplitt.cpp to see the original implementation.
|
|
|
|
|
Is there an equivalent to .Net's GetCurrentMethod for Visual C++ 6?
|
|
|
|
|
Not easily. C++ doesn't provide reflection type information in the way .NET and Java do, meaning that it is very difficult to determine what method you are in etc. unless you implement an appropriate framework yourself.
The other alternative is to build your application with symbols, and then use the stack walking functions to determine where you are - that's not a particularly nice way of doing it though.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Hiya I have a global variable in my lib called 'end'. I really need to have it there, otherwise I would just take it out. My problem is that I need to get the lenght of my file in bytes, so I use
ReadFile.Seek( 0,CFile::end );
MyFileSize = ReadFile.GetPosition();
But this is giving me a error of "constant: illegal token on right side of '::', because of my global variable named the same.
Is there another way to get the lenght of my file without using CFile::end in MFC??
Thanks.
|
|
|
|
|
|
|
Wouldn't the CRT function _filelength() be faster?
onwards and upwards...
|
|
|
|
|
There are two ways to do that:
1) If you have already opened the file use this:
CFileStatus status;
ReadFile.GetStatus(status);
LONG size = status.m_size;
2) more general way is this:
CFileStatus status;
CFile::GetStatus(_T("myfile.dat"),status);
LONG size = status.m_size;
|
|
|
|
|
I'm doing a get text on a drop down box into a CString. I then do a strcpy to a char array so that I can pass this info off to a LPSTR in a cobol DLL.
When I do a GetWindowText on this combo box and then do my strcpy I get an Assertion failed.
So how can I get this info and convert it to a LPSTR with out doing a strcpy. And How do I delete the char array when I'm finished with it?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|