|
DavidCrow wrote: I know of no way of doing it, which is not to say it can't be done.
thats my next question: Are there any documents/documentations wich give information about the c++-hierarchy.. for example like this one-> http://java.sun.com/j2se/1.4.2/docs/api/java/lang/package-tree.html[^]
The Microsoft Platform SDK Documentation isn't a real help.
-- modified at 17:57 Thursday 15th February, 2007
|
|
|
|
|
Perestroyka wrote: Are there any documents/documentations wich give information about the c++-hierarchy..
STL or MFC?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
What you ask for does not exist. C++ does not contain any native classes.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
ok,
for example I want to program something for Shell.. I mean, where to look for the right commands/funtions/BOOLs/....?
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Is it possible to call a function accepting variable args and pass them on to another function directly?
void foo( ... )<br />
{<br />
}<br />
<br />
void bar( ... )<br />
{<br />
foo( );<br />
}
The reason I ask is I have created a macro using __VA_ARGS__. I currently use a helper function to concact them into a string then call the appropriate method.
|
|
|
|
|
AFAIK there is no way, but you can pass a va_list. see vsprintf etc.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
WalderMort wrote: Is it possible to call a function accepting variable args and pass them on to another function directly?
Here is one way...
void VarArgFuncHelper( LPCTSTR lpszFormat, va_list argList )
{
}
void VarArgFunc( LPCTSTR lpszFormat, ... )
{
va_list argList;
va_start(argList, lpszFormat);
VarArgFuncHelper(lpszFormat, argList);
va_end(argList);
}
|
|
|
|
|
That works, thanks Nibu
|
|
|
|
|
I want to use PNL Package{.cpp and .hpp} {Probabilistic Network Library}, and i need to intoduce this package, i use C++.net (Visual Studio 2005).
I test #include"Pnl_dll.hpp" , but it doesn't work. please help me.
have added the hpp files, it happen at compile time.
The exact error message "fatal error C1083: Cannot open include file: 'pnl_dll.hpp': No such file or directory"
please help me.
|
|
|
|
|
abbd wrote: fatal error C1083: Cannot open include file: 'pnl_dll.hpp': No such file or directory
C1083[^]
Include directive[^]
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
C++ does not search your hard drive for the header file, you have to set up your project to know where it is, or provide a full ( relative or absolute ) path to the file. The former is more likely to work.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I'm having somewhat of an issue with the new 'safe' string functions. Take the following example:
char foo[ 512 ] = {0};
strcat_s( foo, 512, "Hello World" );
char bar[ 512 ];
ZeroMemory( bar, 512 );
strcpy_s( bar, 512, foo );
Nothing wrong with the code you might think, but add bar to your watch list. Even though the memory was zero'd out, the string was written, but everything after the null character has been set to 0xFD.
In most cases this is not a problem, but I am using these with a memory mapped file. And it's causing havoc. Even strncpy_s displays the same problem. The only solution is to use CopyMemory() , after calling strlen() and adding the null.
-- modified at 19:11 Tuesday 13th February, 2007
|
|
|
|
|
WalderMort wrote: strcpy_s( bar, 512, bar);
According to MSDN "The behavior of strcpy_s is undefined if the source and destination strings overlap".
But I am sure that is a typo on your part and not what you are after.
Again from MSDN: "The debug versions of these functions first fill the buffer with 0xFD. To disable this behavior, use _CrtSetDebugFillThreshold ".
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
PJ Arends wrote: But I am sure that is a typo on your part and not what you are after.
Well spotted.
I must have missed that part of the docs. I was sure it was a debug only thing, but still, it is annoying.
|
|
|
|
|
I have created a custom control and I place text in it in the OnPaint function. If the user picks in the control, I want to get the text that is under the cursor. How can that be done? My control is derived off of CWnd.
|
|
|
|
|
If it's your own control, you can write a method on the control, which takes a co-ordinate on the screen, turns it into a local co-ordinate, and works out what word it is over. You can do this, as you have complete control over how the text is rendered.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I had the coordinate part figured out, but what I havn't figured out yet is how to tell what word it is over. When I use DrawText to put the text in the control, how can I tell where each word is located in that text? What I am basically trying to do is similar to a hyperlink, if the user picks certain text in the control, I want to perform some action. The only idea I had was to manually figure out each word location when placing them in the control and keep a map of the rectangular area used for each word. But, this would be a lot of work, and memory, and I was hoping there would be an easier way. The text can be multiple paragraphs. Thanks for any suggestions.
|
|
|
|
|
RandyS wrote: The only idea I had was to manually figure out each word location when placing them in the control and keep a map of the rectangular area used for each word.
That's pretty much how a hyperlink works. Once text is rendered to the screen it's just pixels
(unless your video card is in text mode - unlikely with Windows ).
You'd need OCR to convert the pixels back to text.
Alot of work? Maybe. Alot of memory? Nah
|
|
|
|
|
RandyS wrote: When I use DrawText to put the text in the control, how can I tell where each word is located in that text?
There is an API which tells you the size of the text you're rendering, you'd need to render one word at a time and keep track of how big each one is on screen, to work out which word holds which co-ordinates.
RandyS wrote: The only idea I had was to manually figure out each word location when placing them in the control and keep a map of the rectangular area used for each word.
Yes, that's about it.
RandyS wrote: But, this would be a lot of work, and memory
A little work, the memory usage is trivial.
RandyS wrote: and I was hoping there would be an easier way
No. There isn't.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
My program gives me a problem in XP and XP alone. The main program runs fine, but when I open a form that then runs another thread and some other tasks if the user clicks on the dialog while the tasks are being processed the form won't close after the tasks are complete (as it should). The tasks are all completed correctly except the form won't close. I also get a "Not responding message" in the dialog top bar when the user is clicking on the form. I throught maybe i needed to run the DisableProcessWindowsGhosting() function at the beginning of my program, however my program does'nt not seem to recognize that function. I have inclued "winuser.h" as a header. Any thoughts on this, either how to get the DisableProcessWindowsGhosting() to work, or another possible solution.
Note: I have also tried the PeekMessage function but this did not work.
Cheers* Any help would be greatful .
Debs*
|
|
|
|
|
Hi...
If there is a better way to do what I am doing, I'll jump on it.
I am using Sleep(milliseconds) in my code to place strategic waits for time to pass. As an example, I need to stop the application because I know that something going on in the real world will take at least 100 msecs to finish and I don't have anyway to handshake with this device/application. So I put a Sleep(100). This has worked ok until recently when I tried running my app in one of the newer PCs with the real fast processor etc.
Now my Sleep()'s are too short.
Is there a way to figure out what the Sleep() will be in msecs from one PC to another?
Also... what is the accuracy of, let's say, Sleep(20). How close to waiting 20 msecs will that be?
Like I said earlier, if there is a better and more accurate way to do this the using Sleep(), I am open to all suggestions...
Regards and thank you in advance
Pierre
|
|
|
|
|
Use a timer, a timers interval is set in milliseconds.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
That's surprising. I would have thought that calling Sleep(100); would suspend the process for at least (but not necessarily exactly) 100mSec.
/ravi
|
|
|
|