|
Thank you. I will try to find a way around that.
|
|
|
|
|
You need to either copy the memory so only one string consumes each one, or impliment a reference count.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hello,
I am wondering if I can implement a splitter window without a divider? Basically what I am looking for is a setup similar to preferences in Winamp or AOL IM when they have a navigation screen on the left and corresponding views on the right. Clicking on each items brings on a different view on the right. I am not sure how it is implemented and how should I approach this in my project. I thought that it is very similar to a splitter window functionality only without showing a divider...
Does anyone have any comments?
Thank you,
Dmitry
|
|
|
|
|
CSplitterWnd::OnDrawSplitter
I'm drinking triples, seeing double and acting single
|
|
|
|
|
I'm still new to usinging MFC and having problems getting any messages from a new window I create. Could someone please help.
For testing purposes I just created a standard MFC single document program called Test.
In the CTestView class I added logic to create a new overlapped window using the following code:
LPCSTR lpszClassName = AfxRegisterWndClass (
CS_OWNDC | CS_DBLCLKS,
0,0,0);
wndMyCWnd.CreateEx(
WS_EX_OVERLAPPEDWINDOW ,
lpszClassName,
"My New Window",
WS_OVERLAPPED | WS_VISIBLE |WS_CAPTION | WS_SYSMENU |WS_VSCROLL,
200,200,300,400,
m_hWnd, NULL, NULL);
CDC *myDC = wndMyCWnd.GetDC();
myDC->TextOut(10,10,"This is a test",14);
This works fine, my new window is created and I can write text to it. The problem is I can not figure out anyway to get any of the windows messages (IE: WM_MOUSEMOVE) from the new window. I tried putting the above logic in a new class by itslef and then mapping out the messages like I did in the CTestView class, but still unable to ever get any of the messages from the new window I created. I must be missing something simple here, but can not seem to figure it out. Any help would be greatly appreciated.
Eric
|
|
|
|
|
Hello,
I want to use a PropertySheet within a PropertySheet. Normally we can add property pages in PropertySheet but can I add Property sheet or not. I am using MFC classes CPropertySheet and CpropertyPage.
Aamir Butt
|
|
|
|
|
What exactly are you asking here, are you saying can you create a property sheet from within another property sheet, or are you asking if you can display a property sheet within another property sheet???
Mark
|
|
|
|
|
Yes, I am asking that can I display a Property sheet within another Property Sheet.
to be more clear, I have a Property Sheet with two Property Pages in it. Now, I want one of these Property Pages to be a Property Sheet itself in which I could be able to have other Property Pages as well.
|
|
|
|
|
I have been programming for about 2 years now and covered alot of stuff, basic all the way through some advanced topics but today it occured to me that I know all this stuff but don't know how to make header files. Can anyone please show me how to make header files. Not in visual c++ 6 but in old-c++ (console c++) Thankyou.
<marquee>Universal Project... Soon to be a .net
|
|
|
|
|
The basic idea is that the header file defines the behaviour of your class and the class contains the implementation. To make a header file, just fill in the pertinent info and save it as a ".h" file. Then #include that header file at the top of your .cpp file
Example:
#include "anyheadersthisclassneeds.h"
class YourClass
{
public:
YourClass::YourClass();
~YourClass();
void YourClass::Method1();
void YourClass::Method2();
protected:
int nClassMember1;
int nClassMember2;
CString csClassMember3;
};
|
|
|
|
|
OK this is the prototype defs. but How do you define the actual functions, in the header files or the source files.?
<marquee>Universal Project... Soon to be a .net
|
|
|
|
|
Snyp wrote:
this is the prototype defs. but How do you define the actual functions, in the header files or the source files.?
You could define the functions inline to the header file, however the majority of the time you will find the implementation in a coresponding .cpp file. So for the class Terry provided you might have the following:
#include "YourClass.h"
void YourClass::Method1()
{
}
void YourClass::Method2()
{
}
-Nick Parker
DeveloperNotes.com
|
|
|
|
|
THANKYOU!!!;P;);P;);P ;P;) ;);P
<marquee>Universal Project... Soon to be a .net
|
|
|
|
|
Hello!
I am trying to intercept some calls to system DLLs. I've read some articles about how to do that.
Now I want to create a proxy DLL and have a problem. The DLL I want to hook (GDI32) has so many function calls that reimplementing everyone seems impossible.
Is it possible to redirect calls to the proxy DLL by standard? I mean, all functions that aren't exported by the proxy DLL will automatically redirected to the original DLL?
Thanks in advance!
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)
|
|
|
|
|
your question is kinda strange..
you hook apis by creating a dll, which has some of the original functions, and then you redirect these calls to your own dll.
so where is the problem?
Don't try it, just do it!
|
|
|
|
|
The problem is that when I only implement some and not all of the API exported by the original DLL the executable will complain about missing external references.
_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)
|
|
|
|
|
Anyone experienced any problems (memory leaks in my case) with Windows Media Format SDK? I'm using it to retrieve content from network and write to local disk, but looks like it has a memory leak. This is the code I use:
IWMReader* pReader = NULL;
m_hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
HRESULT hr = WMCreateReader(NULL, WMT_RIGHT_PLAYBACK, &pReader);
pReader->Open(L"some_url_here", this, NULL);
WaitForSingleObject(m_hEvent, 60000);
pReader->Close();
pReader->Release();
CloseHandle(m_hEvent);
Both callback functions (OnStatus and OnSample) are empty, just returning S_OK. You see, I'm not starting it, only opening. After I call Open function, memory jumps for about 2.5Mb. When I call Close and Release it goes down around 1.Mb, leaving 1.5Mb in "air". Anyone knows about this?
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Is the memory usage going up by 1.5MB for every file, or just the first? If it's just the first then that's normal. The first time you use any in-proc COM server, your process has to load the server DLL (and any others that it uses) so your working set will increase.
If the working set is an issue, call CoFreeUnusedLibraries() to try to unload in-proc servers with a ref count of 0.
--Mike--
Ericahist [updated Oct 26] | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Well it happens every time I create and open IWMReader. For example (not the full code, just to keep it simple):
WMCreateReader(NULL, WMT_RIGHT_PLAYBACK, &pReader);
pReader->Open(L"URL");
pReader->Close();
pReader->Release();
put this in loop and you get the memory to 100Mb in just a few minutes. But if you won't call Release (and of course won't create it again), mean just Open and Close, then everything is ok. I'll try your suggestion though tomorrow at work. Will see if this is the problem. Thank you
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Philip Patrick wrote:
put this in loop and you get the memory to 100Mb
hmmm, that is worrysome. Which version of the FSDK? I use the FSDK at work, and it's possible that a user could end up doing similar code in a loop over many files, so I'll give it a try at work tomorrow too.
--Mike--
Ericahist [updated Oct 26] | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Actual sign at the laundromat I go to: "No tinting or dying."
|
|
|
|
|
Using the latest version. But...
Now it is something I don't understand at all. The "memory leak" is really depend on the source. I found sources that the same code doesn't produce any leak and sources that it does (all of them have a video stream). Not sure what happens here.
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
I need to retrieve data from 2 tables which one of the fields is a total. i use my own recordset(which inherit from Crecordset ), and i bind the coloms in DoFieldExchange.
now i need to get the field from my recordset but the field which contain the sum function retrieve 0.
This is my select from the 2 tabels tPlan and tUser :
(SELECT tPlan.ID, Sum(tUser.SpaceUsed) AS SumOfSpaceUsed,FROM tPlan INNER JOIN tUser ON tPlan.ID = tUser.PlanID
GROUP BY tPlan.ID;)
i use this way:
void CPlanUserSet ::DoFieldExchange( CFieldExchange* pFX )
{
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Int (pFX,"tPlan.ID",plan_user.m_Pid);
RFX_Int (pFX,"tUser.SpaceUsed",plan_user.m_SpaceUsed );
}
The id field is retrieved but not the Sum of spaceUsed
Any idea????
|
|
|
|
|
Hmm. Got a couple suggestions for you. Might seem really simple so you've probably tried them already, but I'll throw them out there anyway.
The most obvious reason that appears to me is that in RFX_Int for the SpaceUsed you are using "tUser.SpaceUsed". I might be wrong here, since I've never used RFX, but shouldn't that be "SumOfSpaceUsed"?? Since thats what it's saved as in the sql statement.
The only other thing I could think of is that SpaceUsed isn't a number in the database, but it'd probably throw an exception if that was the case.
Mike
|
|
|
|
|
Hello, i want to make a simple program basically doing this:
- system will go to full screen (complete full screen).
- i will put different images on the screen from image files whenever i want,
- if possible i will put animated gifs on the screen.
what would you suggest? is there any very simple example for doing this kind of application than you can give me a link?
Thanks.
|
|
|
|
|
Here's a link to a minimalistic application that creates a new window, paints it black and makes it fullscreen. It is an MFC style solution, using pure MFC methods to do it's work.
http://www.tpu.fi/~t1akeski/FullScreen.zip
It's is heavily commented for easy following. If you wanted to put images to the screen, just look for an article explaining how to BitBlt bitmaps to the window DC. There are many tutorials available on that issue.
In other news, does someone know if there is a bug in the MFC documentation. When I call the CreateEx routine, and pass a CRect as it's size, then the declaration of the function states that I should provide a ID for the window. If I specify this ID to something else than zero/NULL, the app causes an assertion. If I didn't use CRect, the ID parameter would be replaced with some menu handle, suggesting that I should put NULL to it. And if I pass NULL to the ID (when using the CRect version), it works smoothly. Strange, no ?
Greetings,
Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|