|
So where is the problem then.
|
|
|
|
|
Hi,
(I'm new to this list, so pardon me if I'm asking something already covered. I've looked through everything I can find on this site and several others and can't seem to find the answer.)
Here's the problem:
I need to emulate a User Interface on a new product, in order to make a 'remote control'. It has to look and feel as much as possible like the real thing, which is to say it has a knob and a 3 toggle switches.
To implement the switches (and also the knob) I'm thinking about using a spin control without a buddy window. I've sub classed the control, and draw (stretchblt) a bit map of the switch in it's up, down or middle positions accordingly.
This works great for a horizontal switch (left, right and middle), but a vertical switch has the problem that the slider control's width, (like any scrollbar derived control it seems) has a width set by the system (it appears to be based on the Font size in the 'Appearance' menu for the Display Properties).
I need to be able to set the width, in order to get the full width of my bitmap to appear and also in order to make a larger 'sweet spot' for the user to click on.
How can I override the default width of a sub classed Spin Button, or Scroll Bar, etc?
Thanks,
John Miramonti
John Miramonti
|
|
|
|
|
Hi all!
This is a very simple problem, please give me a nice pointer to the solution.
I'm writing long numbers in a textfile with ofstream. The numbers are relatively big but I need the precision. Now ofstream writes the numbers as:
1.17308e+006 instead of 1173080. I'm loosing precision with this, how can I avoid this and make shure it just writes the real numbers (in the not scientific way)?
Thanks!
Aram
|
|
|
|
|
How are you losing precision? As long as all significant digits are displayed in the scientific version, it is just as good if not better. Single precision only has 7.2 significant digits.
http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html[^]
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I suppose you are talking about "long floating point values", not "long int values".
Actually, you are not "loosing" precision. You are just limited to the precision "float" or "double" offers. Not every number can be represented using a double or float. You still only have so many bits to store your floating point variable in.
And as usual, you can still define your own variable type and write all the calculation and transformation stuff yourself
Cheers
Sebastian
|
|
|
|
|
Hi!
I solved it, it was indeed a very stupid little problem. I did the long value * 0.5, but i forgot to cast it (like: (long)(counter*0.5);) that was the trick, thanks anyway!
|
|
|
|
|
Hi everyone,
I want to add my custom search handler in Start Menu -> search options. I somewhere found that I've to make a new subkey in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FindExtensions\Static . I made that subkey and filled with appropriate values also, but still it is not working.
Now foxed ! Any ideas ??
Pravin...
|
|
|
|
|
I have been doing a Context Menu Handler these days.
The first thing I would do is to check the "Shell Programming"-Section of CP.
I used Michael Dunn's Excellent Tutorials to create my own handler.
I hit some obstacles, though:
Have the most recent Platform SDK installed.
Make the proper Registry Entries.
Register your COM-DLL using "regsvr32 path\filename.ext"
Restart your Explorer (Completely. On Win2000 and WinXP you can do that by logging of and back on again.)
Make sure your CLSID is listed in the APPROVED section of the registry, should you not have admin privileges. Check M. Dunns Tutorials on how to do that.
This is about all the advice I can give.
Cheers
Sebastian
|
|
|
|
|
How to copy Print DC to CDC or otherwise ?
I've used CreateCompatibleDC() and BitBlt() but it can't work why ?
Thanks
|
|
|
|
|
If I define STL vector, not bu pointer, but by value
as:
<br />
<br />
typedef vector<CVariableShift> type_DevStrVector;<br />
<br />
struct CVariableShift<br />
{<br />
int i;<br />
};<br />
than how to get copy of stored variable
by iterator?
Only possible bu conversion to pointer ? as :
<br />
<br />
int j = it->i;
<br />
l_VariableShift = *(CVariableShift*)(&it);
<br />
<br />
Is it possible to works without ugly conversion?
thanks.
|
|
|
|
|
I think you're asking the following. I have a vector<int> and an iterator of type vector<int>::iterator (or const_iterator). How do I get the value that the iterator points to?
vector<int>::iterator it;
int iVal = *it;
|
|
|
|
|
|
I'm creating a .xls file using a third-party com component. However this component is unable to protect the sheet using a password.
Does anybody knows a way I can protect the sheet using vc++ (without having microsoft excel installed) ?
|
|
|
|
|
hello friends,
We are doing a project in vc++ for image processing .We used your class(CXImage) in our project for converting user typed text into transparent GIF image. We used the following steps for our requirement.
Note: Operating System : Win XP Professional ,
Development Tool : VC++ 6.0.
1)Create a memoryDC
2)Created a compatible bitmap with the dialog
3)selected the bitmap into MemoryDC
4)Draw Text on that DC
5) Created a CXImage object and passed Bitmap handle to CXImage member function called CreateFromHBITMAP
6) We used the function Save() to save that image.
But the problem ia that we can insert the Image to Frontpage but the image is not visible.
Following code is extracted from our project
void CTestCXImageDlg::OnCreateBMP()
{
CDC memDC;
CBitmap bitmap;
CBrush brush(RGB(255,255,255));
CFont font;
UpdateData();
font.CreateFontIndirect(&logfont);
if(memDC.CreateCompatibleDC(GetDC()))
{
if(bitmap.CreateCompatibleBitmap(GetDC(),200,50))
{
memDC.SelectObject(bitmap);
memDC.SetBkColor(RGB(255,255,255));
memDC.FillRect(CRect(0,0,200,50),&brush);
CRect rect(60,15,200,50);
SetTextColor(memDC.m_hDC,RGB(0,255,0));
memDC.SelectObject(&font);
memDC.DrawText(m_Text,&rect,DT_END_ELLIPSIS | DT_CENTER );
CxImage img1;
img1.CreateFromHBITMAP((HBITMAP)bitmap.m_hObject);
img1.Save("c:\\imgtest.gif",1);
.
.
.
.
eagerly waiting for your response
|
|
|
|
|
Hi, everybody
some one know the algorithm of detecting different regions of two images(with the same size),or give me a link where related information can be found.
My application needs that,but my knowledge about digital image processing is not enough.
Thanks.
|
|
|
|
|
Hi
I create a Dialog, and place a WebBroser control on it.
when user insert one media (Window media, Real, QuickTime, Flash). I bulid html string and view on Web Browsercontrol(depend on file to insert, i naviagate from memory use this string (put_innerHtml).
this my code:
LPDISPATCH lpDispatch = NULL;
IHTMLDocument2* lpHtmlDocument= NULL;
IHTMLElement* lpBodyElm = NULL;
lpDispatch = m_WebCtrlPreview.GetDocument();
if(lpDispatch)
{
lpDispatch->QueryInterface(IID_IHTMLDocument2, (void**)&lpHtmlDocument);
lpDispatch->Release();
}
if(lpHtmlDocument)
{
lpHtmlDocument->get_body(&lpBodyElm);
lpHtmlDocument->Release();
}
if(lpBodyElm)
{
BSTR bstrHtml = szHtmlPreview.AllocSysString();
lpBodyElm->put_innerHTML(bstrHtml);
SysFreeString(bstrHtml);
lpBodyElm->Release();
}
szHtmlPrivew is ok, it contains html string to preview media.
My Application run well, But when i insert a Quick Time movie (*.mov), it play on Web Browser control, and then i insert another kind of media, my application will appears a critical error.
HELP ME
Regards
Trung Huynh
|
|
|
|
|
Hi
I have a MFC-dialog program with a list in it. I have assigned F5 as a hotkey to update the list through the RegisterHotKey function. This works fine
But from the main window I want to open another dialog with a different list in it. I want to use F5 as a update-hotkey in this dialog too .. but I cant get it to work. F5 only updates the list in the main dialog.
I thought that a RegisterHotKey registered a hotkey for the whole system so that I can capture it in every dialog in my program ??
Any help is much appreciated !
|
|
|
|
|
How are you calling RegisterHotKey() ?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I do it like this:
In the maindialogs OnInit-function:
RegisterHotKey(GetSafeHwnd(), m_IDHotKey, NULL, VK_F5);
And add this to the messagemap in every dialog that should use the hotkey:
ON_MESSAGE(WM_HOTKEY,OnHotKey)
And the OnHotKey function looks like this:
LRESULT CFingerIDAdminDlg::OnHotKey(WPARAM wParam, LPARAM lParam)<br />
{<br />
}
It only works for the main dialog ... a F5-keystroke in the child window registrates as a F5-key in the main window. I thought that the WM_HOTKEY-message was going to be handled by the dialog that is active ??
|
|
|
|
|
Have you used Spy++ to see the messages that are being received by both the main window and the child dialogs?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
me think you need to put the handler in all the different dialogs ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I have used FindNextFile for take all file in a directory
but now i have need to know if the current return from to FindNextFile is a link
How can i do?
|
|
|
|
|
Check to see if it has a .lnk extension.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I dont have an extention.
This files are in a UNIX ambient
|
|
|
|
|
What constitutes a shortcut on a Unix box (they used to be called nodes) is different than what constitutes a shortcut on a Windows box. There is no way for a Windows box to "ask" a Unix box if such-and-such file is a shortcut or not.
|
|
|
|