|
LoadLibrary(_T("RICHED32.DLL"));
|
|
|
|
|
Perfect! Thanks alot!
EDIT: How can I auto scroll to the end of the rich edit control?
DKT
|
|
|
|
|
look for [EM_LINESCROLL] message
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I like to write a project about chatting , but i don't know how to begin because i don't have much exprience about it . So can anyone tell me some examples or some code about it ? thks all!!!!!!!!!
|
|
|
|
|
|
I have to read some data from the registry, and will need to use it several times in probably all the parts of my application.
So instead of reading it from the registry every time I need it, I would like to read it once and make it available to all the application parts.
How can I do that? I thought about the Document class but I have more dialogs that can't access this one.
Thanks
|
|
|
|
|
create a registry class with static member variables.
|
|
|
|
|
I was thinking in CWinApp and CDocument, and forgot that I can make my OWN class.
Thanks
|
|
|
|
|
Make the data global. The simplest thing to do is to place it in stdafx.h , marking the declarations with the extern keyword. In the main program, where you retrieve the data from the registry, repeat the declarations without the extern keyword.
Software Zen: delete this;
|
|
|
|
|
Done it with this method in 3 minutes.
Thanks a lot
|
|
|
|
|
You're welcome.
Software Zen: delete this;
|
|
|
|
|
in MFC, why menu commads of a dialog added in normal way can not be sent to their command handlers? why the menu can not be auto-enabled (disabled)?
how to solve the problems?
thx
includeh10
|
|
|
|
|
Hello!
How can I open .col files with hh.exe? I already installed the latest version of HtmlHelp Workshop and tried to run the hhupd.exe, but it tells me that I got a newer version already (I'm using Windows XP SP2).
Do I have to install any update? How to make hh.exe open .col files?
Thanks in advance and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hey guys,
Anyone knows about how to dynamically import a class from a dynamically loaded win32 DLL. ( I dont have the .lib file nor the header file for the dll) but i know the names of classes in the dll.
furthermore, can I (using VC++ 6) import classes written in VC# 7.0 as a DLL and use them in my VC++ app?
Need help plz
Regards
|
|
|
|
|
Well it's tricky. What you usually do is define a function that creates and returns a pointer to a class and then a function that destroys the object passed. If you don't have the complete class definition, this is as good as you'll get because you will never be able to create an object yourself. How could you without it's definition? The compiler requires this, even pointers to functions imported from DLLs are defined before they are used. Search www.deja.com for "import classes from DLL dynamically" for more information.
|
|
|
|
|
There is even a better way: use COM
But in that case without the source code it's quite tricky. What kind of DLL is it?
Don't try it, just do it!
|
|
|
|
|
Really its tricky, the problem is that the DLL is created with Visual C# 7.0, but I want to import its classes to my project, which is a VC++ 6.0 project, I dont even know if this is possible. (are these two languages compatible?)
Any help will be appreciated.
Regards,
Mohammad
|
|
|
|
|
Hello Everyone,
How to see all items of "tip of the day" at once of VC++? Where do these tips are in hard disk? Thanks.
|
|
|
|
|
If you are talking about VC++ 6.0
Microsoft Visual Studio\Common\MSDev98\Bin\IDE\MSDEV.TIP
Microsoft Visual Studio\Common\MSDev98\Bin\IDE\TOOLS.TIP
Microsoft Visual Studio\Common\MSDev98\Bin\IDE\VCXX.TIP
I haven't seen the tip of the day feature in VStudio.net
Ali
|
|
|
|
|
I am going to create an method to insert Items inside the hash table, However, i don't really know what I should code inside the method.
Should I use push or pop because it is based on a list container for my private attribute.
Here is my code.
hashtable.h
Code:
//HashTable.h
#ifndef HASHTABLE_H
#define HASHTABLE_H
#include <list>using namespace std;
template <typename keytype,="" typename="" valuetype="">
class HashTable
{
public:
void insertItem( const string& key, const VALUETYPE& value );
VALUETYPE getItem( const string& key ) const;
void dump() const;
private:
enum { TABLESIZE = 20 };
struct KeyValuePair {
KEYTYPE key;
VALUETYPE value;
};
list<keyvaluepair> hashTable[ TABLESIZE ];
unsigned getIndex( const char* key ) const; // Hash Function
};
#include "hashtable.tem"
#endif
hashtable.tem
Code:
//hashtable.tem
template <typename keytype,="" typename="" valuetype="">
void HashTable<keytype,valuetype>::insertItem( const string& key, const VALUETYPE& value ) {
}
template <typename keytype,="" typename="" valuetype="">
void HashTable<keytype,valuetype>::dump() const {
for( unsigned iCtr = 0; iCtr < TABLESIZE; iCtr++ ) {
cout << "Bucket #" << iCtr << " contains: ";
list<keyvaluepair>::const_iterator iter;
for( iter = hashTable[ iCtr ].begin(); iter != hashTable[ iCtr ].end(); ++iter ) {
cout << '[' << iter->key.c_str() << ',' << iter->value << ']' << ' ';
}
cout << endl;
}
}
// End of file
Thanks for advice
|
|
|
|
|
hash tables are more like a map, or an array (vector).
Anyway, why aren't you using the stl hash_map class?
AliR
|
|
|
|
|
I am going to write an enumerated type that identifies the suit of the jail cell. However, it should be from another class - Card.
I tried to code it like that
Code:
enum card::suit; //an enumerated type (located in the Card ADT) that identifies the suit of the jail cell
I think it is not going to work, can anyone gives me some suggest?
Here is the code from card.h
Code:
#include <iostream>
using namespace std;
class Card
{
public:
enum Rank
{
ACE,
TWO,
THREE,
FOUR,
FIVE,
SIX,
SEVEN,
EIGHT,
NINE,
TEN,
JACK,
QUEEN,
KING
};
enum Suit
{
SPADES,
HEARTS,
CLUBS,
DIAMONDS
};
Card(); // Default constructor will initialize to Ace of Spades
Card( Rank newRank, Suit newSuit );
Rank getRank() const {return rank;}
Suit getSuit() const {return suit;}
void setRank( Rank newRank );
void setSuit( Suit newSuit );
private:
Rank rank;
Suit suit;
};
ostream& operator<<( ostream& os, const Card& card );
appericate it.
|
|
|
|
|
Since your enum are declared under the public portion of your class you will be able to access it. You should take note that C++ is a case sensitive language. Using your class definition you can use the enum like so:
Card::Suit s;<br />
Card::Rank r;<br />
<br />
r = Card::JACK;<br />
r = Card::HEARTS;
|
|
|
|
|
So you mean in my class
I should code it like that:
private:
stack<card> cards; //an STL stack of Card ADT's
Card::Suit s;
Card::Rank r; //an enumerated type (located in the Card ADT) that identifies the suit of the jail cell
|
|
|
|
|
Yes, if Card::Suit is in another class, if your doing it from the class where Suit and Rank are defined then you can just use Suit and Rank without the Card::, that would be redundant. Your STL stack syntax is wrong, it would be something like std::stack<Card> cards;
|
|
|
|