|
I have tried to use this one to get Video Card information
particulary driver information. When I try to open Resource
View there is an error message pops up saying "atlres.h"
can't be found. Some one has the same experience?
Shin
|
|
|
|
|
|
Hi there,
please help me here!
is there a way i can insert, a ruler in a plain text editor like the one in word pad/Microsoft Word so that i can be able to format, my words or pictures for printing.
How can i also insert static text in a text editor?.
Very gratefull in advance.
thanks
|
|
|
|
|
I developed a application and used datagrid control in this program. Now I want to install this application in no VC environment but I found it did not work? Could anyone tell me how to deal with it?
|
|
|
|
|
Hi,
Does anyone knows how to register a DirectX filter (*.ax) from a application program without using Regsrv32 xxx.ax?
|
|
|
|
|
Call the DllRegister method of the DLL.
You might not have to do this: it is possible to use a filter directly in your program without having registered it. I'm assuming that intelligent connect won't find it and you have to do some weird stuff (use the new operator on a COM object). Search for a SampleGrabber example program on MSDN. I found it a while ago for an older version of DirectX, and did some fiddling but I got it to work.
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
|
|
|
|
|
Hi, all
I am experiencing a problem with the Rich Edit box (version 1.0) using regular Win32 API (no MFC). I am trying to write a function that will search through a specified range of content in the control (the text). I am using the SendMessage() function with the EM_FINDTEXTEX flag and the FINDTEXTEX structure. But the problem is that it can’t seem to find any matches. For ex. I have set the control with the text “is there any matches?” and I set the function to search for the word “any” but won’t find any thing. The function has been written to return the number of matches it finds, the following code is the function I have written. Can anyone please help me figure out the problem?
int FindText(HWND hEdit, char *Text, CHARRANGE *Range) {
FINDTEXTEX TextSearch;
int MatchCount = 0;
int MatchFound;
TextSearch.chrg = *Range;
TextSearch.lpstrText = Text;
TextSearch.chrgText.cpMin = -1;
while (1) {
MatchFound = SendMessage(hEdit, EM_FINDTEXTEX, FR_WHOLEWORD, (LPARAM) &TextSearch);
if (TextSearch.chrgText.cpMin != -1) {
MatchCount++;
if (MatchFound != -1)
TextSearch.chrg.cpMin = MatchFound;
else break;
} else break;
}
return MatchCount;
}
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
I'm working with the code below and want to make a jukebox. How can I play one of several songs randomly?
#include stdlib.h
int main()
{
system( "start c:\\cpp\\pickmeup.mid" );
/* or just system( "c:\\cpp\\pickmeup" ); */
return 0;
}
Thanks, Dave
"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson
|
|
|
|
|
(1) Read all song (file) names into an array (say N items)
(2) Pick a random number between 1 and N and use that
entry from your array.
|
|
|
|
|
I was hoping to find some code to generate a random number. I can use a switch statement (or an array as you mentioned), but I don't know how to generate a random number. Any ideas?
Thanks in advance, Dave
"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson
|
|
|
|
|
OK, here's what you need to do:
(1) Somewhere near the start of your program, seed the random
number generator using time of day. This ensures that
you don't get the same numbers every time:
srand((unsigned)time(NULL));
(2) Then, every time you need a random number (betrween 0 and iN)
ifile=(rand() % (unsigned)(iN));
That should do it.
|
|
|
|
|
Or should I say, a question about sound. The code below brings up my Windows Media Player, but I don't hear any sound. I can play other system sounds, but for some reason I don't hear any sound when I play my MIDI file. I do see the song playing, but don't hear the sound. Any ideas?
#include stdlib.h
int main()
{
system( "start c:\\cpp\\pickmeup.mid" );
/* or just system( "c:\\cpp\\pickmeup" ); */
return 0;
}
Thanks, Dave
"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson
|
|
|
|
|
i'm looking for a good UML software!
does some1 have experiences with that, or how else do u plan your software?
Don't try it, just do it!
|
|
|
|
|
|
Ok, doesn't anyone know anything about LSP's?? I'm really stuck here..
I downloaded the layered sample from MSDN and compiled it and installed the LSP, but after that none of my internet apps work anymore. I've looked into what exactly is happening, and it seems that its some problem with the DNS. When i dont have the LSP installed, it just resolves addresses, or even doesnt and starts sending tcp data immediately when i open my browser, but when its installed, it sends a UDP packet for trying to resolve the hostname or something and gets a UDP packet reply and then all traffic just ends...thats it..
Thank you very much for any suggestions whatsoever!!
Kuniva
--------------------------------------------
|
|
|
|
|
I have a DLL I need to use, and it came with a header file and a DEF file. They appear to have been written in C. I need to make a LIB file from the DEF file before the DLL is useable. I tried using the LIB command with the /DEF switch, but I must not be using it correctly. I also found instructions to modify the header file, compile to get an OBJ file, and then use the LIB command to create a LIB file, but I didn't succeed at that either. Does anyone know how to do this? Here's part of the header file.
#if defined(CALLED_DLL)
# define DLL_IMPORT __declspec(dllexport)
#else
# define DLL_IMPORT __declspec(dllimport)
#endif
extern "C" int DLL_IMPORT __stdcall StoreX(
char* FilePath,
char* ServerAddress
);
#endif
Here's the DEF file:
LIBRARY MYDLL.DLL
EXPORTS
StoreX@80 @1 ; StoreX
|
|
|
|
|
I've heard this many times before and I'm wondering why is that? Why is MFC considered bad OOP?
I should mention that I have no experience in MFC (or else I could prbably see why myself ), but have programmed in Java for years. I'm just curious about this. ;)
Tangently:
What API would you recommend for a good solid client side window app (Java is not an option). .NET or MFC (or other)? I have some experience with .NET but in some ways it doesn't seem solid enough, so I'm wondering if I should use some time learning MFC and use that instead. Any advice?
Lastly, does MFC have a steep learning curve?
"Yeah, I would've killed you, but I'm glad I didn't - the paperwork is a bitch"
|
|
|
|
|
Rohde wrote:
Why is MFC considered bad OOP?
rotfl.
What apart from the mess of macros, the half baked serialization, the thin wrapper around a functional api, some of the bizarre choices for base classes, strange naming conventions and the fact that it is old, and that C++, and programming in general have matured since MFC was first released. Oh. And the documentation, I don't want to bag MSDN, it's comprehensive, but it's a bloody side harder to navigate around than the Java API documentation.
Rohde wrote:
What API would you recommend for a good solid client side window app (Java is not an option).
C#. Java is pretty much dead in the water as far as I'm concerned.
If it has to be C++, you're pretty much stuck. You probably need to know at least a little MFC to get your head around WTL which is far more readable IMO.
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
|
|
|
|
|
MFC was designed when OOP was just starting. The VC++ compiler back then was bad, did not support
the full C++ standard and the STL was not yet designed.
So MFC is full of crude hacks to circumvent the copiler bugs. It sports its own set of containers (with a flawed design) instead of using the STL ones.
Newer frameworks usually have better OO design.
But I can't help you which one to choose. I do not know enough of them.
Rohde wrote:
Lastly, does MFC have a steep learning curve?
If you know Win32 before, it is just a thin wrapper. But for starting, it may be sometimes puzzeling. But OTOH, you get more books and articles for help than you ever can read.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Rohde wrote:
Why is MFC considered bad OOP?
One thing that was not mentioned by the others, is that views rely on being hosted in a frame. In a true OO heirarchy, this is not important - classes do not rely on where they are being used. A class should be self-contained - it should not rely on other classes unless the two are specifically used together, like a list view with a header control. But even in this case, the header control has no idea that it is being used inside a list view.
Ryan "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"
|
|
|
|
|
Ryan Binns wrote:
One thing that was not mentioned by the others, is that views rely on being hosted in a frame. In a true OO heirarchy, this is not important - classes do not rely on where they are being used.
This is just one example out of a frightening number which shows that the MFC designers 1) didn't understand OOP methodology and 2) didn't even understand the features of C++.
Classes are inherited from other classes without taking advantage of polymorphism in obvious cases (see the mess of Create functions in objects derived from CGDIObject).
A reliance on macros to make their message mapping nonsense functional should have been a signal that they needed to START OVER and try again.
Why is CPropertySheet on a different branch of the class hierarchy chart than CDialog? I quote from the documentation: Objects of class CPropertySheet represent property sheets, otherwise known as tab dialog boxes.
I know a lot of the idiocy of MFC is directly inherited from the idiocy of the Windows API, but there is much that is brand new MFC flavored idiocy.
|
|
|
|
|
David Kentley wrote:
This is just one example out of a frightening number which shows that the MFC designers 1) didn't understand OOP methodology
That's understandable. OOP methodology was not very well developed when MFC was first written. Retaining compatibility means that what they originally wrote had to be kept.
David Kentley wrote:
A reliance on macros to make their message mapping nonsense functional should have been a signal that they needed to START OVER and try again.
Aaaah. That one's easy to explain . MFC was written before the MS compiler supported templates. I'd like to see you implement message maps without using macros or templates . And once it was written, it had to be kept for compatibility reasons.
David Kentley wrote:
Why is CPropertySheet on a different branch of the class hierarchy chart than CDialog?
Because in the Win32 API, property sheets are not tabbed dialogs. They are completely separate. Sure, you could inherit CPropertySheet from CDialog , but you'd have to replace the entire behaviour of the class - not exactly a prime candidate for inheritance.
Ryan "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"
|
|
|
|
|
Ryan Binns wrote:
Aaaah. That one's easy to explain . MFC was written before the MS compiler supported templates. I'd like to see you implement message maps without using macros or templates
Hmmm, how would you implement message maps with templates? AFAIK, WTL also uses macros for message maps. "OO aproach" would be to use some form of Observer pattern, but it would introduce some performance penalty.
|
|
|
|
|
Nemanja Trifunovic wrote:
Hmmm, how would you implement message maps with templates?
Using .NET-style delegates with functors. I'm in the middle of an article on this at the moment. Hopefully I'll have it finished in the next couple of days.
Ryan "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"
|
|
|
|
|
That's a good idea! Write an article on your C++ delegate. Then other people besides just the GUI Library group can use it.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|