|
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.
|
|
|
|
|
That's true. Unless you can execute something like a stat() on the file at the UNIX end, you have no way of determining that it is anything other than a regular file. You can't even tell if it's a file with multiple hard links, much less something more esoteric, like a soft link or a device file.
Steve S
|
|
|
|
|
Hello !
Juste a little question.
What is exactly the difference between delete and delete[] ?
Is the second used to delete memory allocated for more than one element and the first when only one element was allocated ?
Thanks
|
|
|
|
|
delete[] assumes that the block of memory pointed at is an array of (the same kind of) objects where the delete operator needs to call the destructor for each element in the array.
Rob Manderson
Paul Watson wrote:What sense would you most dislike loosing?
Ian Darling replied.
Telepathy
Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003
|
|
|
|
|
Both c++ commands are used to deallocate memory that was previously created. However, delete [] instructs the compiler that the given memory location is an array of allocated space (usually created using the new [] keyword).
The general rule is to use
delete with new and
delete [] with new []
I Dream of Absolute Zero
|
|
|
|