|
Hi
I have tooltips (CToolTipCtrl) over an Edit box. Normaly this tooltip appears according to the mouse pointer.
Do You know ?
1) How can I move top left corner of the tooltip into the top left corner of the edit box associated?
2) How can I change the height of the tooltip into the height of edit box associated?
Thank you very much
|
|
|
|
|
Hi
I have several documents in my MFC project, and when a start my program i get a dialog
box which let me choose which document type I want to use.
How do I get hold of that Dialog box so that I could modify it?
best regards
//Fredrik
|
|
|
|
|
Hi,
I've been chasing a solution to this in newsgroups etc. for the best part of a year without a single response. Using VC++ 6 SP5 on Win89. VS won't allow add-ins to start and reports that each add-in's server object couldn't be started. One or two did work for a while but none do now. Any ideas?
|
|
|
|
|
Hello Gary,
Do you have Visual C++ 5.0 installed on your machine ? If so, make sure that all add-ins (with the same version) are installed for both VC++ 6.0 and VC++ 5.0.
A few weeks ago, I had the same problem. One of my add-ins was a newer version and I got it installed for my Visual C++ 6.0. It won't start up. I then installed the same version for my VC++ 5.0. Things worked.
Best of luck, Gary,
Bio.
|
|
|
|
|
My boss likes data displayed in disabled edit boxes (ugh!), however recentily I have been badgered to adapt the edit box so that if, the amount of text in the box necessiates a Scroll Bar being displayed, one will automatically appear, otherwise if there is not enough text to necessiate a scrollbar, none is shown.
Is there any easy way of achieving this.
Regards
Ray
"Je Suis Mort De Rire"
|
|
|
|
|
One thing you may want to try is to change the style of your control to
Read Only. The control may still get the focus so the user can view all
data by using the arrow keys. By disabling a window, the scrollbar too is
disabled.
- God bless the World
|
|
|
|
|
How can I use a CReBar in a CHtmlDialog-Based application?. I create the
ReBar an add a band but it isn't displayed because it isn't a CFrameWnd in which be displayes. Thanks
Jose Vicente
|
|
|
|
|
Hi,
I created an SDI Application.I want remove the Toolbar and Menu from my Application. For that I created a Class from CFrameWnd and attached it to the DocumentTemplate and Changed the dafault menu item as NULL.I am getting the output window with a lot of assertion failure.What all steps I need to follow to remove the ToolBar and Menu from the Application.
Help please.
SSN
|
|
|
|
|
*IF* you are using VC6,
Removing Menu:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.hMenu = NULL;
return CFrameWnd::PreCreateWindow(cs);
}
I belive previous version of MFC were getting p*ssed if you try this...
So old aproach was create window with menu. Create own message WM_APP+100, post this message from OnCreate, and when you get this message
do something like this:
HMENU h = GetMenu();
SetMenu(NULL);
DestroyMenu(h);
Toolbar is easy, change on create to look something like this:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
return 0;
}
|
|
|
|
|
|
The toolbar you can remove when you are creating your SDI application, you'll find an option, to create or not to create the tool bar there.
To remove menu, you have to override CFrameWnd::LoadFrame() of your Frame window and place a code inside it, like this:
BOOL CMainFrame::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle, CWnd* pParentWnd, CCreateContext* pContext)
{
BOOL bRetVal = CFrameWnd::LoadFrame(nIDResource, dwDefaultStyle, pParentWnd, pContext);
if(bRetVal){
GetMenu()->DestroyMenu();
SetMenu(NULL);
}
return bRetVal;
}
Philip Patrick
"Two beer or not two beer?" <shakesbeer>
Web-site: www.saintopatrick.com
|
|
|
|
|
I'm working on a small program with two list controls declared as
<br />
CListCtrl List1, List2;<br />
These are public member variables of CListTestDlg .
The effect I want is for the contents of List2 to change depending on which row was clicked in List1. I have created a handler for the WM_NOTIFY message to handle the NM_CLICK message.
<br />
BOOL CListTestDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) <br />
{<br />
LV_DISPINFO* lvDispInfo = (LV_DISPINFO*) lParam;<br />
CEdit* pEdit;<br />
<br />
switch (lvDispInfo->hdr.code)<br />
{<br />
case LVN_BEGINLABELEDIT:
pEdit = List1.GetEditControl();<br />
break;<br />
case LVN_ENDLABELEDIT:<br />
if ((lvDispInfo->item.pszText != NULL) && (lvDispInfo->item.iItem != -1))<br />
{<br />
List1.SetItemText(lvDispInfo->item.iItem, 0, lvDispInfo->item.pszText);<br />
}<br />
break;<br />
case NM_CLICK:<br />
char text[11];<br />
int i;<br />
<br />
while ((List2.GetItemCount() > 0) && (lvDispInfo->item.iItem != -1))<br />
List2.DeleteItem(0);<br />
List1.GetItemText(lvDispInfo->item.iItem, 2, text, 10);<br />
i = atoi(text);<br />
while (i-- > 0)<br />
{<br />
List1.GetItemText(lvDispInfo->item.iItem, 0, text, 10);<br />
List2.InsertItem(lvDispInfo->item.iItem, text);<br />
}<br />
break;<br />
}<br />
}<br />
The problem I have is that for the NM_CLICK part of the switch statement, lvDispInfo->item.iItem is always zero, regardless of which row is clicked on. However, if I use lvDispInfo->item.mask instead of lvDispInfo->item.iItem things work as I would like.
lvDispInfo->item.iItem appears to be set correctly when dealing with LVN_BEGINLABELEDIT and LVN_ENDLABELEDIT parts are processed.
Please tell me what am I missing?
Paresh Solanki
A Completly Random Ordering Never Yields Meaning
|
|
|
|
|
Are you programming for WinCE?
If not, so here is your problem. The structure LV_DISPINFO is defined and working ONLY in WinCE. In Win32 you have to cast your lParam to LPNMITEMACTIVATE and you will get the item index in iItem member of this struct. Or -1 if no item was selected
Philip Patrick
"Two beer or not two beer?" <shakesbeer>
Web-site: www.saintopatrick.com
|
|
|
|
|
Thanks
I had tried NMLVDISPINFO, but that gave the same results as LV_DISPINFO, couldn't see LPNMITEMACTIVATE on MSDN, but it does what I want.
Paresh Solanki
A Completly Random Ordering Never Yields Meaning
|
|
|
|
|
Yep, sorry, look for NMITEMACTIVATE in MSDN.
LPNMITEMACTIVATE is just a pointer to it
Philip Patrick
"Two beer or not two beer?" <shakesbeer>
Web-site: www.saintopatrick.com
|
|
|
|
|
I am using fragments of code from Microsoft OneInstance sample. When application starts and it founds other instance window, it activates it using next code:
pWndPrev = CWnd::FindWindow(lpszUniqueClass,NULL);
if ( pWndPrev )
{
pWndChild = pWndPrev->GetLastActivePopup();
if (pWndPrev->IsIconic())
pWndPrev->ShowWindow(SW_RESTORE);
pWndChild->SetForegroundWindow();
}
In Windows XP, if pWndPrev is minimized, it is not restored. This code works fine in all previous Windows versions. What changes should be done in this code to work properly in XP ?
|
|
|
|
|
Hi -
I also would love to find a code solution to your problem, but I think it's a registry tweak, which requires a re-login after changing.
HKEY_CURRENT_USER\Control Panel\Desktop
set ForegroundLockTimeout = 0 (DWORD)
set ForegroundFlashCount = 0 (DWORD)
A short article on this at:
http://www.windows2000faq.com/Articles/Index.cfm?ArticleID=15978
If you do find a code solution, please post to this thread.
|
|
|
|
|
|
How can I prevent a user from accessing my ISAPI extension directly from his browser?
I have an ISAPI extension that can be accessed by the URL - <nobr>[http://www.mysite.com/scripts/myisapi.dll?query=value]
I access the extension from an asp page through a form submit request. Now my problem is that anybody smart enough to decipher the url and the query string that needs to be provided to the extension can access it successfully. I would want to prevent this access. How can I go about achieving this?
|
|
|
|
|
Hi,
I can't think of a simple way to do this, but you could modify you ASP code to add an application-specific HTTP header field to the request (I think - I don't know ASP real well) and check for that header in your ISAPI extension. A user could potentially write their own code to include that header, but it would at least prevent someone executing the ISAPI from their browser.
Another possibility is the HTTP header HTTP_QUERY_REFERER which is not always provided, but would show the URL that linked to the ISAPI extension. You'll just need to make sure that the URL matches your ASP page.
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
thanks derek !
I have considered your advice. But the methods suggested above are not void of loopholes. Http headers are prone to tampering and URL addresses can be spoofed.
I have been looking at the method by which asp pages are prevented from malicious access by the use of session ids. I am talking about the session ids created by the ASP engine. But I have no idea of how to access the same session id in my extension. I want to obtain the session id from the asp engine directly from my extension.
Is this possible?
|
|
|
|
|
Hi,
As far as I know, there is no way to get the session id outside of ASP (which is not to say that there isn't a way!).
If you are attempting to prevent malicious use of the ISAPI extension, would it be possible to encrypt the query string before passing it to the ISAPI DLL? If the ISAPI DLL reads the query string and can't decode it, then assume it comes from a spurious source and do something accordingly. We use a similar system to this (although our encryption is done by a client-side app, rather than an ASP page).
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Hi,
I need to retrieve the logical coordinates of the printer, I tried to use this:
CSize Test;
Test.cx = pDC->GetDeviceCaps(HORZRES);
Test.cy = pDC->GetDeviceCaps(VERTRES);
The I use that logical coordinates to print a metafile, but seems that the coordinates are not the right ones ( they are small), how can I retrieve that logical size ?, Thanks, Bye !
Braulio
|
|
|
|
|
I think your problem is in the conversion. Metafile needs coordinates in .01 millimeter units.
Try something like this:
RECT rc;
rc.top = rc.left = 0;
int iWidthMM = pDC->GetDeviceCaps(HORZSIZE);
int iHeightMM = pDC->GetDeviceCaps(VERTSIZE);
int iWidthPels = pDC->GetDeviceCaps(HORZRES);
int iHeightPels = pDC->GetDeviceCaps(VERTRES);
rc.right = (nWidth * iWidthMM * 100)/iWidthPels;
rc.bottom = (nHeight * iHeightMM * 100)/iHeightPels;
HDC hMetaDC = CreateEnhMetaFile(pDC->GetSafeHdc(),_T("C:\\Temp\\Image.emf"), &rc, _T("Your Description\0Image\0\0"));
- God bless the World
|
|
|
|
|
Hi,
I would like to rotate 90º a metafile, in order to make fit two pages in one if the user chooses to print in A3 format. How can I rotate a metafile ?.
Thanks, Bye !
Braulio
|
|
|
|