|
Leslie Sanford wrote: EDIT: Strange. I changed the code to ::LoadCursor(NULL, IDC_ARROW), and it fixed the problem.
Not so strange if you have a look at documentation [^]:
To use one of the predefined cursors, the application must set the hInstance parameter to NULL
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Not so strange if you have a look at documentation
Yup. I should have checked out the documenation. Having worked with the Windows API this long, I should have realized that simply taking a function at face value and passing it what it appears to want is not always the correct thing to do.
Sorry if that sounds like whining. It's just that these special cases, these gotchas, add up over time to a point of making an API hard to use.
|
|
|
|
|
Reading the documentation is the best way to avoid headaches, when dealing with Windows API .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
seems like i just got aome people angry at me by not posting code the right way in the message
Just read up on the tag/pretag so......
My question is do I have to put a start tag / end tag on every line of code that
I post ?????? in addtion when I tag my code do I have to check the ignore HTML box or
not
thankx and sorry
|
|
|
|
|
put your code between pre tags.
|
|
|
|
|
Maximilien wrote: /// some coed
Got something else on your mind?
|
|
|
|
|
You should use the code block button or, manually, the <pre> tags, this way:
<code><pre></code>
<code></pre></code>
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ForNow wrote: seems like i just got aome people angry
Angry? We may have had some fun with you but I didn't see anyone getting angry. Did I miss something?
led mike
|
|
|
|
|
|
Hi all!
I implement 2 hooks: for MS Outlook 2003 and for Outlook Express. MS Outlook 2003 interception was implemented on IMAPIAdviseSink. But I have some problems with Outlook Express 6. After research I find library msoe.dll which used by OE 6 and export some MAPI functions (MAPILogon, MAPISendMail, MAPIReadMail etc). I inject custom hook into msoe.dll on MAPILogon, MAPILogoff, MAPISendMail, MAPIReadMail, but I cannot received any notification about call its by OE6. How are other ways for hook send/receive messages from Outlook Express 6? Thanks.
|
|
|
|
|
Hi
I am trying to create a MFC control made out of two edits and a pseudo-tab control... they are all children controls of a CWnd. I want to make sure that when the controls gets the focus through a tab, one of the 2 edit controls gets the focus and if another tab is pressed, that the focus goes to the next control in the parent dialog.
I am aware of WS_TABSTOP ( I use it to create the CWnd) but that des not seem to do the trick... any tips?
Thanks in advance
|
|
|
|
|
Do you mean that your control is a CWnd which hosts 2 edits and that tab and is a child window of another window? If so, make your "host" CWnd WS_CONTROLPARENT and also make it WS_TABSTOP. Hope that helps, good luck.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Is the MFC DLL created with option "Regular DLL using shared MFC DLL" is reentrant / thread-safe?
If not, how to create reentrant DLL using VC 2005?
Thanks in advance!!
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
You have the source code.
I don't recall seeing anything thread safe in the MFC code.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
It seems, reentrancy is wholly depend on the code.
Here are some rules for code to be reentrant:
Reentrancy[^]
And the code is as follows, the dll function will give the content of given file name:
<br />
void extern "C" __declspec(dllexport) getFileContent(LPCTSTR strFile, LPCTSTR& lpStrOut)<br />
{ <br />
CFile pFile;<br />
pFile.Open(strFile, CFile::modeRead);<br />
int iLen = pFile.GetLength();<br />
char *ch = new char[iLen+1];<br />
pFile.Seek(0, CFile::begin);<br />
pFile.Read(&ch[0], iLen); <br />
ch[iLen] = '\0';<br />
lpStrOut = ch;<br />
pFile.Close();<br />
}<br />
The function is reading file content into character array and returns pointer to the content.
As it does not use any static variable, but allocating and returning "new" character array, is it reentrant?
With Thanks & Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
As long as all the calls made in the function are reentrant then you're OK.
Additionally, "new" is thread safe.
On a side note, "ch" should be of type TCHAR*, not a char*, since you're using
generic text mappings (the 'T' in LPCTSTR).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello All,
i am working in VS 6 using VC++ Win32 ::
I made a window using CreateWindowEx API and WNDCLASSEX Structure
with Background Brush as (HOLLOW_BRUSH) and Style as WS_EX_TRANSPARENT...
These 2 things made my window transparent....But the problem is when i maximize other window over my created window, its Background color changes to maximized window, that should not happen .......i always want my window background as desktop.....
Any suggesstion is heartly appreciated
|
|
|
|
|
This a "repainting" pbm : there is sort of an asynchrnous notification that needs be handled and but it is not.
WM_ACTIVATE issue ? I do'nt have sufficient facts to reason and tell you.
Good luck.
|
|
|
|
|
You want to make your window a sort of "hole" on the screen that lets you see the desktop all the time? I doubt there's a sane way of doing that, you could try hooking into explorer's process and somehow make the desktop window's part that your window is over being drawn onto your window but i don't much recommend it.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
|
Hello,
We have an application icon on desktop. If I drag and drop any file / folder to the MyApp desktop icon. Then it works fine on Windows XP and Vista. But, the same process is not working with Windows Ultimate 7. Also it is not getting focus while holding any file / folder on the MyApp desktop icon.
Other functionalities are working fine on all platforms; like doubleclick, rightclick->open file, etc.
Also Win7 can move file / folder using drag and drop functionality.
So request you to suggest me why this is happening and is there any way to overcome this issue?
Thank you.
With regards,
Shashikant
|
|
|
|
|
Windows Ultimate 7 ??
|
|
|
|
|
There 2 32bpp bitmaps with some images:
bitmap1
bitmap2
and graphics object g1 created from bitmap1
I set individualy alpha values in bitmap2 using LockBits:
Gdiplus::BitmapData bitmapData;
Gdiplus::Status s = pBitmap->LockBits(&Gdiplus::Rect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight()),
Gdiplus::ImageLockModeWrite | Gdiplus::ImageLockModeRead,
PixelFormat32bppRGB, &bitmapData);
if (s == Gdiplus::Ok) {
unsigned int* pPixels = (unsigned int *)bitmapData.Scan0;
for (unsigned int i = 0; i < bitmapData.Height; i++) {
for (unsigned int j = 0; j < bitmapData.Width; j++) {
if (mask(i, j) > 0)
pPixels[j] &= 0xFFFFFFFF;
else
pPixels[j] = 0x00FFFFFF;
}
pPixels += bitmapData.Stride / 4;
}
pBitmap->UnlockBits(&bitmapData);
}
And then draw it on bitmap1 using g1. But the alpha blending does not happen?
chesnokov
|
|
|
|
|
I don't see where you're doing any alpha blending. Alpha blending would mean blending the values of two bitmaps. What are you trying to do ?
Also, have you stepped through the code to see if mask(i,j) is ever > 0 ?
I assume that mask is a method, calling a method for every pixel will really slow your code down.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
sure. mask is a unsigned int version of
http://www.codeproject.com/KB/recipes/SSE_optimized_2D_vector.aspx[^]
it is inline operator(y,x) for m_data[y][x].
it has print() function so you can view its contents before hand.
I need to turn off some pixels in bitmap2 by setting their A values to 0, so if you draw it to bitmap2, the pixels with A = 0 will not affect bitmap1 pixels
chesnokov
|
|
|
|