|
aks. wrote: NetFileEnum() returned NERR_Success, but the bufptr is NULL.
What is the value of dwEntriesread and dwTotalentries ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
I have created slider bar dynamically using create function. now i want to create one integer control for the slider bar.
Can any one help me how to create DDX control for the slider bar..
I have added DDX control in DoDataExchange function like this:-
DDX_Slider(pDX,IDC_SLIDER1, m_Pos);
but the app is crashing..
Can any one help me regarding this..?
Any help will be appriciated..
Thanks
Venki
|
|
|
|
|
Does it crash or does it raise a debug assertion? If it is the later, check where the assert comes from, there are useful hints about problems as comments in the MFC code...
> 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 Code-o-mat,
i am getting below error in the debugging state..
TRACE1("Error: no data exchange control with ID 0x%04X.\n", nIDC);
along with this i am getting other error :-
"An unsupported operation was attempted"
can you please let me know what i can do now..?
Thanks
Venki
|
|
|
|
|
Well, what this generally means is that it did not find any control with that id (IDC_SLIDER1) on the dialog. Are you sure that is the ID you gave to your dynamically created slider? And are you sure you placed the DDX_Slider entry in the class of the correct dialog?
Also, are you sure you created your slider BEFORE DoDataExchange runs? If you did something like this:
BOOL CMyDialog::OnInitDialog()
{
__super::OnInitDialog();
m_mySlider.Create(...)
...
That won't work since during the __super::OnInitDialog() call your DoDataExchange will be fired...so instead, do it like:
BOOL CMyDialog::OnInitDialog()
{
m_mySlider.Create(...)
__super::OnInitDialog();
...
> 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 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
|
|
|
|