|
|
Hi all...
plz read it completely...may be it will be helpfull for you also...
I am facing one problem, I get exception in the InitDialog of CPropertySheet()...
I have a Class named CXPropertySheet which is derived from CPropertySheet, I need this class because I want some extra effects and capabilites in property pages and propertysheet, like resizability painting background color etc...
I also have one class derived from CTabCtrl, which I use to paint tab buttons on tab control. I subclass this class to tab control of CXPropertySheet...
in the InitDialog of main dialog...
m_pPropertySheet = new CXPropertySheet("Logkey", this);
//++ Add pages to the property sheet
m_pPropertySheet->AddPage(&m_firstPage);
m_pPropertySheet->AddPage(&m_secondPage);
.
.
//++ display the property sheet...
m_pPropertySheet->Create(this, WS_CHILD | WS_VISIBLE);
//++ Modify the style,
m_pPropertySheet->ModifyStyleEx(0, WS_EX_CONTROLPARENT);
m_pPropertySheet->ModifyStyle(0, DS_CONTROL);
///////////////////////////////////////////////////////////////////////////////////////
In the InitDialog of the CXPropertySheet....to make it resizable…I wrote this code…
// I get exception here...
writeToTrace("CPropertySheet::OnInitDialog");
BOOL bResult = CPropertySheet::OnInitDialog();
writeToTrace("CXPropertySheet::OnInitDialog");
/* Subclass the tab control. */
m_myTabCtrl.SubclassWindow(GetTabControl()->m_hWnd);
writeToTrace("Subclassed the tab control");
/* Make it owner drawn. */
m_myTabCtrl.ModifyStyle(0, TCS_OWNERDRAWFIXED);
If I run it in debug it runs fine....It runs with Release build as well but in very inconsistent manner... but only on my machine...which is Win2000 professional...
I will be very grateful if anybody could give your thought for this problem, I am sorry if I have not described the problem properly...
thanx and regards...
Avya
Avya.
|
|
|
|
|
What is the exact exception you are getting?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
I dont know what that exception was....but fortunately I solved the prob....
I think the problem was I was deriving property sheet from CPropertySheet nad the property pages from my other class, which is derived from CPropertyPage, so in InitDiaog of Properysheet it was not able to add the pages, I suppose. Then I changed the aproach and derived all the property pages from CProperyPage...Noe it is working fine...
Anyways thanks for reply...I would like to get tou comment on this...why it may give exception if the propery pages arent derived directly from CProperyPage...
Thanks and regards
Avya.
|
|
|
|
|
Hi all,
I want to delete temp internet file placed in the directory
C:\Documents and Settings\user1\Local Settings\Temporary Internet Files.
Is any Api available in vc++ which can do this work?
rajesh
|
|
|
|
|
See _unlink() , DeleteFile() and CFile::Remove() .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
I posted a question about tooltips for controls not so long ago.
After searching and searching and searching again I found a solution so I thought I'd share with you.
Problem: The tooltips for controls in a groupbox do not show
even if you moved the position of the groupbox to the back/front (left and right ). Nothing seemed to help.
solution: I called a TrackMouseEvent to create mouse hover messages. I handled this message in a PreTranslateMessage function. There you can determine which window called the message ... and it works!
(PS: actually I set a static text as tooltip for various reasons, but the principle stays the same.)
here's the code in PreTranslateMessage:
BOOL CWFSEC2MailerTestDlg::PreTranslateMessage(MSG *pMsg){<br />
CWnd *window=CWnd::FromHandle(pMsg->hwnd);<br />
<br />
TRACKMOUSEEVENT trackmouseevent;<br />
trackmouseevent.cbSize = sizeof(trackmouseevent);<br />
trackmouseevent.dwFlags = TME_HOVER;<br />
trackmouseevent.dwHoverTime= 0;
if(window != NULL){<br />
trackmouseevent.hwndTrack = window->m_hWnd;<br />
TrackMouseEvent(&trackmouseevent);<br />
}<br />
<br />
switch (pMsg->message){<br />
case WM_MOUSEHOVER: if(!hover_on){<br />
SetToolTipText(window->m_hWnd);<br />
hover_on = true;<br />
}
break; <br />
case WM_MOUSELEAVE: hover_on = false;<br />
break;<br />
case WM_LBUTTONUP: Invalidate();<br />
break;<br />
default:
break;<br />
}
return CDialog::PreTranslateMessage(pMsg);<br />
}
tnx to all who tried to help...!
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Can someone suggest a simple way to shrink/ stretch a BMP? Better not involving MFC. Thanks.
|
|
|
|
|
try that function.....CDC::StretchBlt
|
|
|
|
|
I knew that...;P
Maybe need to talk in more detail...
Some function would provide the BITMAPINFOHEADER and Bitmap buffer data. I wanna change the size of the resulting BMP. The step I thought was that:
1. call CreateCompatibleDC( ) to create a memory DC.
2. call CreateCompatibleBitmap( ), get the handle of a bitmap and use last-created memory DC to select it.
3. call memcpy( ) to copy the data to the last-created compatible bitmap.
4. call StretchBlt( ) from the memory DC to the dialog DC( or memory DC number 2 ).
For I need to save time, the data of the BMP after stretch need to be saved. So...the following work may required to be done only once.
5. call GetCurrentBitmap for the dialog DC( or memory DC number 2 ).
6. call CBitmap::GetBitmapBits( ), get the data( upset-down, need to flip. )
7. CreateDIBSection( ) for the new data in new size.
8. OK, next time when repaint is required, simply use a memory DC to select these bitmap handles and call BitBlt from a memory DC to dialog DC.
( The steps concerning with the deleting of some temp GDI objects are omitted. )
OMG! Too many steps... Is there a simpler way than that? Thanks!
|
|
|
|
|
|
Hi...
How i can access Windows NT bu knowing the username and password via VC++. I am trtying to pass parameters vis URL but there is pop window asking for password and username first so i need to pass this point then send the URL.
|
|
|
|
|
IIRC You can pass the username and password within the URL.
e.g. http://username:password@site.com
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
i tried what you told me but i am geting error page " page cannot be open"...any other suggestions?
|
|
|
|
|
Um, perhaps this only works when the site supports Basic Authentication. I am not sure what you could do to get around this.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
My application (under VC++ .net) should communicate with external hardware, with a protocol that requires the carriage return sent as a control character.
However, when I add the "\r" to the string, e.g.
string s1="\r00220101\r";
my program seem to go nuts.
I use a simple console program for test purposes,and when I try to print the string with "cout", the string doesn´t print at all and the order of the other "cout´s" seem totally random. There are no similar problems with "\n" or "\t".
Does anybody have a suggestion
regards
doneirik
|
|
|
|
|
Hi,
I too dont have any correct idea, but you can try doing one thing.
try clearing the output stream, perhaps using something equivalent to
fflush(stdin) or a flushall before cout ing anything.
Hope that helps.
Bye.
AslFunky
|
|
|
|
|
solved it. (more or less)
|
|
|
|
|
Please share so that others may benefit.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Actually I don´t know exactly what was the cause...
1. I tried to send the characters using a string or character array. Forgot that en extra "\0" is added. This might have caused some problems.
2.The number of bytes to write parameter in the writefile function: I passed it as an int, then as a short. Had problems with int not with short.
Still I don´t understand why or if this really caused the problems, and why it was only with the "\r"..
doneirik
|
|
|
|
|
Hello all,
I am writing a DLL that wraps another DLL in an interface that can be called from VB.
the dll ahs a callback function defined as
typedef int(_cdecl *cbfuncText)(int HisNodeID, char *str, void *arg);
In my wrapper DLL i have a function that translates this into a new Callbac function
that is defined as
typedef int(__stdcall *cbWfuncText)(int HisNodeID, char* str, void *arg);
When i use the C string directly as shown here VB gets an empty string.
when i try to use a BSTR instead, the VB program crashes.
The VB function i use in the 2 situations are
Function TextCB(ByVal HisNodeID As Long, ByVal str As String, ByRef arg As Long) As Long
and
Function TextCB(ByVal HisNodeID As Long, ByRef str As String, ByRef arg As Long) As Long
Can anybody tell me what i am doing wrong?
and/or give me suggestions of how to solve this?
In Advance thanks
Michael
|
|
|
|
|
When am building my application using DirectX(DirectShow) components,
am getting the following Linker errors:
Linking...
error LNK2001: unresolved external symbol _IID_IMediaEvent
error LNK2001: unresolved external symbol _IID_IMediaControl
error LNK2001: unresolved external symbol _CLSID_FilterGraph
error LNK2001: unresolved external symbol _IID_IGraphBuilder
Debug/trial_DShow.exe : fatal error LNK1120: 4 unresolved externals
Can anyone help in what scenario does the above errors pitch in.??
Thanks, Pramod.
|
|
|
|
|
Hi,
You have to link the needed libs. Think that you have to add strmiids.lib explicity in the linker options
Hope that this will help you
Sujan
|
|
|
|
|
Usually, the link error 2001 means that you didn't link libraries required. The help file of the directshow has a page "Setting Up the Build Environment". Read this page and you'll find these libraries required:
Strmiids.lib
Quartz.lib ( not required if you don't call AMGetErrorText(), can be omitted in your case. )
If you don't know how to link these libraries, a simple way is provided in the following:
1. Click the Menu:
(In Visual C++ 6.0)
Tools -> Options -> Directories, and then choose item of the combobox below the text "Show Directories for" Library Files and set the path of these 2 libraries.
(In Visual Studio .Net)
Tools -> Options -> Projects -> VC++ Directories , and then choose item of the combobox below the text "Show Directories for" Library Files and set the path of these 2 libraries.
2. Add the following codes to where you want to include some files(Ex: You can add them in stdafx.h):
#include "Dshow.h"<br />
#pragma comment ( lib, "Strmiids" )<br />
#pragma comment ( lib, "Quartz" )
good luck!
|
|
|
|
|
Hello developers.
I want ask you if anybody konws how can I create a application which will transfer bits (bytes)
throught a USB port - i mean input/output something like it was in old DOS enviroments using inportp/outportb.
This is why I need to communicate with an own unknown device attached to USB and know that a driver must be created but I don't realy want to use the DDK. Is there a other way to create this
driver?
Apropo: can I get a link to a full example or source code to a USB driver tutorial it will be very helpful
|
|
|
|