|
Can sombody help me?
I`ve read all postings but I can`t find something it helps me!
Why different the result of PdhGetFormattedCounterValue function(ex - "\\Process(process_name)\\% Processor Time") and Windows Task Manager?
O/S : Windows 2000 Server.
CPU : Dual-CPU
single CPU, Windows 2000 professional is no problem.
help me!!!
|
|
|
|
|
i know to use setupcomm() to set the size of i/o com buffers.
but how can i get its default size?
Thank u very much!
Hello World!
|
|
|
|
|
Hi all,
Firstly, how do I create a group box programmatically?
Secondly, I want the following to work:
m_MyGroupBox is my group box (CStatic). Surprise...
m_MyGroupBox->ShowWindow(SW_HIDE).
How can I make the controls "inside" the group box to also disappear?
By simply saying that m_MyGroupBox is the parent when creating the inner ctrls?
Thx,
/Tommy
|
|
|
|
|
You'll have to manually hide each of the controls. Setting the parent to the group box will break MFC's handling of dialog box controls, so I don't recommend doing it.
Hope this helps,
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"
|
|
|
|
|
Hi, how can i force my CEdit control to react to Ctrl +v and Ctrl+c. It doesnt do it automaticaly.
I tried the following but it doesnt work out :
dirive OnKeyDown in my class CEditEx
if ((::GetKeyState (VK_CONTROL)<0)&&(nChar == 0x63))
{
// do something
}
doesnt work with GetAsyncKeyState too.
Any sugestion why? Or there is other method to do this stuff?
Thanks
|
|
|
|
|
Hello
i have been asked to look at a dll "issue"
and i cant see why its acting up.
However, when the dll builds the linker throws a headcase and spews out a bunch of errors
<br />
<br />
ClientState.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
DisplayControl.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
EquipmentID.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
FaultData.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
MSCIntraInterface.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
MsgQueue.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
TcpListener.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
Sort of thing
The RPD_APP_EXT is defined in "globaldefines.h" which uses
<br />
#ifndef GlobalDefines_h<br />
#define GlobalDefines_h<br />
<br />
const char * RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"};<br />
<br />
etc etc<br />
<br />
#endif<br />
<br />
And as well as that the header files for every class all correctly use
#ifndef < sometag >
#define < some tag >
.
(.class definitions etc)
#endif
also,The compiler settings are set with the multithreaded /md option
I was wondering if anyone had any suggestions as to what one might do to fix this issue?
regards
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
Maybe char* const RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"};
Hello World!
|
|
|
|
|
|
Try this...in globaldefines.h, say
#ifndef GlobalDefines_h
#define GlobalDefines_h
...other code...
extern const char* RPD_APP_FILE_EXT[];
...other code...
#endif
And then in some other .cpp file (perhaps globaldefines.cpp), do the actual definition of RPD_APP_FILE_EXT, i.e. in the cpp file:
#include "globaldefines.h"
const char* RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"};
...other code...
Even if you have include-guards on your headers, if they're included in multiple places and have variable definitions (not just declarations), then you'll usually get those link errors.
HTH
|
|
|
|
|
maybe because you can not initialize variables in header files?
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
all fixed now, turns out one of the developers had been messing with the project settings
cheers all
bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
I'm having all kinds of fun trying to iron out this problem, and im SURE there's an easy solution out there...
I need to use COM interop between unmanaged C++ and VB .NET to have my C++ client catch and respond to events raised in VB .NET. More specifically, I've got a VB .NET custom user ActiveX control with a valid COM interface that I've imported and used in my C++ client. I can make function calls from the COM client to the .NET server, but I cannot seem to handle events from the control.
I'm certainly no expert on COM interop, but I've browsed around and read bits of literature here and there on how to do this to no avail. The control doesn't seem to have any connection points to which I can connect to (which might be the problem), but trying to use ATL SINK_ENTRY with IDispEventImpl hasn't worked, nor has an MFC DECLARE_EVENTSINK_MAP with ON_EVENTs. I'm at a total loss and any help would be greatly appreciated.
P.S. if none of this works, would it be feasible to pass VB a C++ function pointer via its COM interface and then have VB "call" the C++ function using this pointer? They're in the same address space so it should work, but can VB call a function given only an address as a long?
|
|
|
|
|
My PC is a "32 bit system".
That means 32 bit address bus
=> the highest address is 2^32 - 1 = 4294967296
That means also 32 bit data bus. (4 Byte per word)
=> the maximum of adressable memory is 4 * (2^32 - 1) = 17179869184
now programming in c/c++:
sizeof( char ) = 1 (byte)
difference of pointers of two successive char variables : 1
sizeof( int ) = 4
difference of pointers of two successive int variables : 4
sizeof( any Pointer ) = 4
=> A char pointer must contain information about which of the 4 bytes in a 32 bit word is meant, and also information of the address on the address bus.
=> I cannot access the maximum of adressable memory with pointers, but only a fouth of it. (or less?)
AM I RIGHT???
Friedrich
|
|
|
|
|
The maximum addressable memory is not 4 * (232-1), but rather (232-1), so there is no problem of the sort you describe. What a pointer stores is the address of a single byte (a char , roughly speaking,) not a full 32-bit word.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
An Intel-architecture PC is a byte-addressable machine but you seem to be thinking about word-addressable machines which are quite rare nowadays.
Each byte has its own memory address, so the addressable memory space for a single process (without funny tricks with segment registers) is 4 GiBytes, not 4 GiWords. All the memory space is addressable with 32 bit pointers.
|
|
|
|
|
I've been hunting around and haven't dug up anything yet. I actually wrote one myself but I am not happy with it. I am about to start again but was hoping that maybe someone worked out all the kinks in some generic form I could adapt.
I have a rather large project that uses something very similar to a variant object. I can have anywhere from 10 to 50,000 instance of these classes at any one time and they are created and destroyed many, many times during the program's execution (which may last weeks at a time - Windows permitting). I want to avoid memory fragmentation and just make this application more speedy in general.
Thanks,
Paul
|
|
|
|
|
For STL containers, I wrote some time ago a block allocator that you can find here[^]. Most likely you're not using STL, but even so it's not hard to encapsulate the class into an interface that better suits your needs.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks!
I looked at it and I think I might be able to use it. I was concerned of the MS compiler issues with templates but your code comments to that effect are helpful. If I can come up with a general, generic form of this that can be used for any class, I might post it to this site (with due credit to you).
Thanks again,
Paul
|
|
|
|
|
Hi Paul,
Much of the interface present in block_allocator is meant only to comply with STL requirements and it's not useful for a general pool class. The following is a (not even compiled) sketch of what a general pool class might look like:
#include "blockallocator.h"
template <typename T,size_t chunk_size> pool
{
public:
T* create(T& t=T())
{
T* p=reinterpret_cast<T*>(alloc._Charalloc(sizeof(T)));
alloc.construct(p,t);
return p;
}
void destroy(T* p)
{
alloc.destroy(p);
alloc.deallocate(p,1);
}
private:
pool(const pool&);
pool& operator=(const pool&);
block_allocator<T,T,chunk_size> alloc;
};
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Where the heck is the profiler ? I've enabled profiling in my project setting,
I know I have to go thru (sp?) the VC install, but I didn't see it. is it on the other install CD ? I only have CD1 with me.
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
How can i change the color for a ListBox's text and background in Vc++ ?
|
|
|
|
|
One solution is custom draw. Derive a class from CListBox or whatever is do custom draw on the background.
Kuphryn
|
|
|
|
|
I need to find out if Subclassing is the only option. I would like to know if it can be done in other ways without sub classing . I was assuming that when u can have a method to change the Font in a List or Edit box there should surely be a method to do Color change !
|
|
|
|
|
Look into WM_CTLCOLORLISTBOX .
Jeremy Falcon
|
|
|
|
|
Hello,
can You tell me how to print various page number with MFC?for example,i have a variable X which user enters and i want to print X pages and every page have different text:
"This is Page %X"
Thanks.;)
|
|
|
|