|
Hi Code-o-mat,
I am able to solve the problem with the help of your tip, thank you so much for your help.
I have one more small doubt, i have created pointer object for the CSliderCtrl like this: CSliderCtrl *track_bar;
trakbar = new CSliderCtrl;
Can't we create normal object instead of pointer object..? if there is any way to create that please kindly let me know..
Thanks
Venki
|
|
|
|
|
Why don't you simply create a member of your dialog class of type CSliderCtrl? Like this:
class CMyDialog: public CDialog
{
...
CSliderCtrl m_myPreciousSlider;
...
};
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
I'm trying to intercept the copy/move operation between two explorer windows, but can't seem to know how to do this.. i already try to implement a shell extension with no success and now i'm turning to hook the explorer process.. but with no success too.
The idea is simple, when a user drags a file from a explorer folder into another explorer or another explorer folder, my code will verify the file contents and if desired cancel the copy/move operation.
Can anyone point me to a solution on how to accomplish this?
Thanks
Nuno
Nuno
|
|
|
|
|
|
I have not found this interface yet and i'm not sure what this thing does.. i will give a look at it and see what it does..
Thanks
Nuno
|
|
|
|
|
Did you include shlobj.h?
BTW, this interface is deprecated in Windows Vista.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
What did you try to hook?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
nothing really... I'm yet trying to figure how the all thing works.. if you have any suggestion please do tell that i really appreciate. (i'm seeing some codeproject articles on the subject)
Nuno
Nuno
|
|
|
|
|
Well, i would try hooking DoDragDrop[^], if you are lucky, explorer uses that method to perform the drag-drop, this method, as the documentation says, gets an IDataObject[^] and an IDropSource[^] pointer, maybe you could use these to analyze what is being dragged. Finding out where the data is being dragged to could pose a problem though...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi, thanks for the suggestion, but the DoDragDrop is only called on the begining of the drag and drop process. And i will never known where is the source and if is a move or copy operation.
I tried to hook the SHFileOperationW and i can get all the things that i needed, but the problem is that the FO_DELETE operation allways crash the explorer process, even if i don't have any code inside my hook function implementation:
int MySHFileOperation(LPSHFILEOPSTRUCT lpFileOp)
{
VirtualProtect((LPVOID)pOrigSHFOPAddress, SIZE, myProtect, NULL); //ReadWrite again
memcpy(pOrigSHFOPAddress, oldBytes, SIZE); //Unhook API
int nRes = SHFileOperation(lpFileOp);
memcpy(pOrigSHFOPAddress, JMP, SIZE); //Rehook API
VirtualProtect((LPVOID)pOrigSHFOPAddress, SIZE, oldProtect, NULL); //Normal setts
return nRes;
}
PS: i used the technique described by AlexAbramov in "API Hooking with MS Detours" without the detours
I think i will try another approach for my problem... there are a few problems with the hook approach, one is that the SHFileOperation is deprecated in vista, and another i think that this approach is a little unorthodox..
So i will try to find another way of doing this, if anyone has some better suggestion please feel free to post it
Thanks
Nuno
|
|
|
|
|
Hi everybody
in my application i open a view to display the "products information"
In this view i have a TabControl within 3 Views.
Each of these Views has more than 100 controls (labels with textboxes)
So over 350 controls totally.
If i open this window i freeze the Desktop-Screen
and at the last execution point of my code, i release the Screen and redraw.
I measured the elapsed time for all the work to show this window.
It takes 0,3 seconds.
If i remove all controls from the views, i get a time less than 0,1 seconds.
Is there a possibility to speed up the traitment ( < 0,3seconds )
If not, why does it take exactly so long?
Big thanks for any information.
|
|
|
|
|
You could try to put the 100 controls into a dialog and add the dialog into the view instead of the controls.
«_Superman_»
|
|
|
|
|
I dont exactly know what you mean.
But i use a CFormView as View.
There is a Ressource Dialog with the textboxes.
So i create the view with the dialog ressource.
Thanks for your help
|
|
|
|
|
I'm not sure if this will improve the speed, but what I'm saying is that, instead of placing the 100 odd controls in the form view directly, place them in a new dialog and then place this dialog in the form view as a child dialog. The child dialog will need its border set to none.
«_Superman_»
|
|
|
|
|
Hi,
Is there any method to create a file of desired size whenever I create a file using CreateFile().
|
|
|
|
|
SetEndOfFile can be used to extend or truncate a file.
«_Superman_»
|
|
|
|
|
Hi,
I am using IShellFolder to create tree like explorer. I got the ITEMIDLIST
for all item but I am confused to add to ITEMIDLIST list into one. because Desktop is has empty ITEMIDLIST (Root Folder) then how to add Child (say My computer )ITEMIDLIST to parent(Desktop) ITEMIDLIST ?
|
|
|
|
|
This article[^] has code for a 'concatenate ITEMIDLISTs' function.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi All,
I am using an ActiveX control for Thermal Printing in my website.... It is working fine for most of the client but now it is causig am unarthodox problem....
Once the activex is installed... it prints the label for first time only but when I issues the command for second time... the website hangs...
Closing the browser and logging again solve the purpose but only for the first print command... for second print command it hangs.
please sugest what is causing the problem???
Thanks in advance,
Vishav
ce
|
|
|
|
|
Hi there.
I want to connect to SQL Server 2008 through my C++ code.
As of now, I am doing the same as below
HRESULT hr = S_OK;
hr = m_pConnection->Open(L"DRIVER={sql server};SERVER=Server_Name;Database=DB_Name;" L"UID=UserID; PWD=Password;", L"", L"", adOpenUnspecified);
But above call throws an exception.
FYI, I am using msado15.dll to establish the connection.
I have also tried...
hr = m_pConnection->Open(L"Driver={SQL Server};Server=Server_Name;Database=DB_Name;", L"UID=UserID;", L"PWD=Password;", adOpenUnspecified);
But I am at the same stage.
Please let me know, if I need to implement the same by any other way.
Thanks
PanB
|
|
|
|
|
Hows about you mention what exception gets thrown - that usually gives you information about what error's occurred. Also, what's the type of m_pConnection is?
Oh - and have you verified you can connect to the database through some other utility?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for the reply buddy.
m_pConnection is of _ConnectionPtr type. I am able to test the connection using Visual Studio's Server Explorer option.
I am getting an error "Invalid Connection"
Any pointers on this.
Just a question...Do you think that there is no problem with my connection string or I need some modification do be done?
PanB
|
|
|
|
|
May be very stupid questions but
1. Are you calling CoInitialize?
2. How did you create instance of m_pConnection?
3. Did you verify that m_pConnection is not null?
4. Did you try to catch the exception using _com_error catch block to get the exact description of the problem?
Regards,
Sandip.
|
|
|
|
|
Anyway, Its always good to ask questions.
1. Are you calling CoInitialize?
PanB> Yes, I have a call to ::CoInitialize(NULL); in the constructor itself.
2. How did you create instance of m_pConnection?
PanB> Its a public member in my class.
_ConnectionPtr m_pConnection;
and in the CDataAccessManager::OpenDB() fucntions, I am initializing the same.
3. Did you verify that m_pConnection is not null?
PanB> I think, that is what you are talking about. In the CTor... I am initializing and calling CreateInstance as below...
m_pConnection = NULL;
m_strConnection = _T("");
m_pConnection.CreateInstance(__uuidof(Connection));
Am I suppose to first allocate memory for the same? please sugegst.
4. Did you try to catch the exception using _com_error catch block to get the exact description of the problem?
PanB> Yes, I have something like...
try
{
hr = m_pConnection->Open(L"Driver={SQL Server};Server=Server_Name;Database=Database_Name;", L"UID=UserName;", L"PWD=Password;", adOpenUnspecified);
return hr == S_OK;
}
catch(_com_error &e)
{
dump_com_error(e);
return FALSE;
}
How can I get more information regarding the exception? Please sugegst that as well.
Thanks
PanB
|
|
|
|
|
As an exception I am getting...
{E_FAIL}
m_hresult E_FAIL
m_perrinfo 0x02228530
m_pszMsg 0x00000000 <bad ptr="">
Above info. may help you...
|
|
|
|