|
I'm use WH_GETMESSAGE and WH_SHELL hooks in my program without any strange performance effects. Why do you need to create separate thread? I'm perform needed actions by posting message (PostMessage API) in main window when I plan to do long time action handling (because PostMessage don't stops the thread), and by sending message (SendMessage API) for simple actions.
Sorry for wrong English )
|
|
|
|
|
Hi,
In a dialog-based application, i need finding all of the cd-rom
drivers and then needs open, close, read and write the to cd-rom.
I want to use the low-level SCSI commands to operate all of these.
I want to know if it is possible for embeding such low-level
scsi commands code into the VC++ code. Where can i get some
useful info for doing this? Where can i find some materials (simple
example code) for SCSI commands code?
Thanks in advance!
chen
|
|
|
|
|
|
Hi Dana Holt,
Thanks a lot!
I have read the materials about ASPI for win32. and download
some files. I try to make a simple test program.
I have scsidefs.h, wnaspi32.h and some code such as AspiStart()
ScsiBusScan(),ScsiInquiry(), ... , but i failed. Is there other header files i am missing ?
chen
|
|
|
|
|
chen wrote:
I have read the materials about ASPI for win32. and download
some files. I try to make a simple test program.
I have scsidefs.h, wnaspi32.h and some code such as AspiStart()
ScsiBusScan(),ScsiInquiry(), ... , but i failed. Is there other header files i am missing ?
I have not gotten a chance to write any code, so am not sure what the problem would be.
Did the program compile? If so, then the header files should be ok.
That's about all the help I can offer with my experience.
--
Dana Holt
Xenos Software
|
|
|
|
|
You might want to check out akrip.
|
|
|
|
|
I have a static control on a dialog which has the 'Notify' style set, so that it sends notification messages when clicked on. But if I click on the control when it contains no text it pops up an Explorer window, this doesn't happen when the control contains text. I used Spy++ to check the messages the dialog window was getting and this is the result:
1. Mouse click on static control containing text (ok)...
<00207> 00170324 R WM_ACTIVATE
<00208> 00170324 S DM_GETDEFID
<00209> 00170324 R DM_GETDEFID wHasDef:DC_HASDEFID wDefID:0001
<00210> 00170324 S WM_COMMAND wNotifyCode:STN_CLICKED wID:1003 hwndCtl:0016048E
2. Mouse click on static control not containing text (pops up Explorer window)...
<00173> 00130326 R WM_ACTIVATE
<00174> 00130326 S DM_GETDEFID
<00175> 00130326 R DM_GETDEFID wHasDef:DC_HASDEFID wDefID:0001
<00176> 00130326 S WM_DDE_INITIATE hwnd:000A0418 aApp:C049 ("Folders") aTopic:C04A ("AppProperties")
<00177> 00130326 R WM_DDE_INITIATE
...
<00228> 00130326 S WM_COMMAND wNotifyCode:STN_CLICKED wID:1003 hwndCtl:001104DE
I looks like the WM_DDE_INITIATE message is the problem, but where is this message coming from?! and why?
|
|
|
|
|
|
Hello,
I'm have the need to write a custom window arrangement routine (like the normal tile, cascade, etc) in an MFC MDI app.
What i'm need to do is "stack" MDI child windows of a certain CMdiChildWnd derived type, while minimizing all other MDIChild frame windows.
Does CMidFrameWnd maintain a list of pointers to it's child frame windows? If not, any idea how i can enumerate the child frames, and figure out what CMDIChildWnd-derived type they are?
Thanks,
Heywood
|
|
|
|
|
Hi !
I was working on Device Independent Bitmap (DIB) and wanted to shrink my image down to a thumbnail size, so used the
StretchDIBits() function.
But the shrinking lead to a severe color loss. Why ????
Is there anyway I can shrink my DIB without color loss.
Please Help
|
|
|
|
|
SetStretchBltMode(COLORONCOLOR);
-c
Cheap oil. It's worth it!
|
|
|
|
|
Hi !!
It worked just fine.. The image is perfect now.
Thanks a lot.
Green.
|
|
|
|
|
If you don't mind it still looking bad on Win9x, you can try calling SetStretchBltMode(HALFTONE); prior to calling StretchDIBits() . Caveat: i know it works with StretchBlt() , but i've never tried it with StretchDIBits() .
---Shog9---
From now on we can call C# and MC++ "The square wheel languages" -- Jack Handy, The Lounge
|
|
|
|
|
Hi !!
Well, It did work for StretchDIBits().
The image is perfect now...
Thanks a lot.
Green.
|
|
|
|
|
Hi !!
Well, It worked for StretchDIBits().
The image is perfect now...
Thanks a lot.
Green.
|
|
|
|
|
Hi.
I have an interesting problem. I am working on a program with with a CEditView window. I use GetEditCtrl().SetWindowsText to update the view with new text. Whenever I call SetWIndowsText, the CEditView repaint the entire view, but it always resets the scroll position. For example, let say I am view line 200. (line 200 is at top of view). Whenever I update the view, CEditView resets the current view to line 0.
Is there a way to set what line should CEditView beginning?
Thanks,
Kuphryn
|
|
|
|
|
Use
CEdit& edit = GetEditCtrl() ;
edit.LineScroll(200,0) ;
|
|
|
|
|
Thanks.
A special thanks to Scott McPhillips of MSDN newsgroup also for the solution (he posted it yesterday).
Kuphryn
|
|
|
|
|
Hi,
CStringArray& MyArrayFunction()
{
CStringArray aArray;
aArray.SetSize(...
aArray.SetAt(...
...
return aArray;
}
Question1: is the return line OK?
Question2: how can I fill another array in my code with the returned stringarray?
I tried
CStringArray aMyArray = MyArrayFunction();
but
error C2440: 'initializing' : cannot convert from 'class CStringArray' to 'class CStringArray'
is the answer.
Could you please help me?
Thanks a lot
Ricardo
|
|
|
|
|
change to:
CStringArray* MyArrayFunction()
{
CStringArray *paArray = new CStringArray();
paArray->SetSize(...);
return paArray;
}
getting the array
CStringArray *paMyArray = MyArrayFunction();
do not foget to delete paMyArray;
soptest
|
|
|
|
|
|
I have the following problem. I have included this header file many times in my code with no problems. Then I "included" it into a new file which now produces errors in my typedef statement. I really dont know if it is a problem with namespace as I have no idea how to use that correctly anyway.
Code for "entity.h"
<br />
#include <list.h><br />
<br />
using namespace std ;<br />
<br />
typedef struct<br />
{<br />
int ref;<br />
std::string name;<br />
<br />
}EntityData;<br />
typedef list<EntityData> ENTITYLIST;<br />
How can I include this file with out errors??
Code for "NewFile.cpp"
<br />
#include "stdafx.h"<br />
#include "NewFile.h"<br />
#include <list.h><br />
#include "entity.h"
using namespace std;
Pease help!!
---
|
|
|
|
|
Ooops, Rather than delete this message I will just post my solution.
Use <list> instead of <List.h>
---
|
|
|
|
|
what is the error?
soptest
|
|
|
|
|
It didnt understand the list definition in my header file. This is now fixed due to the way I included the list.h file. I.E #include <list> without a .h
Thanks anyway.
---
|
|
|
|