|
Thank you. Thank you very much for ur support.
And ofcourse thank you for tolerating me as well..(as commented by Rajesh)
French is the language of love, for everything else there is c++ ...(anonymous)
|
|
|
|
|
I needed a edit box in the browse for folder dialog.(SHBrowseForFolder()). So I defined a Browseforfolder Callback function. I created an editbox in the BFFM_INITIALIZED message inside the callback. Then I need to get the text from the editbox when OK is pressed.
But the callback is not called when the dialog exits!..
So how can get the text from the edit box...?
TIA
|
|
|
|
|
Hi All
How can i find Cut and Drag and Drop Files/FOlders Path?Can any one give me Suggestion how can i fiend it?Plz help me
|
|
|
|
|
In a project from some time back, I used the following code. You'll have to modify it so that all of the filenames are retrieved. (This code only retrieved the first one)
UINT getDroppedFilesCount(HANDLE hdrop)
{
UINT queryIndex = -1;
char returnBuffer[MAX_PATH] = "";
int bufferSize = MAX_PATH;
return DragQueryFile((HDROP)hdrop, queryIndex, returnBuffer, bufferSize);
}
void getDroppedFileName(HANDLE hdrop, char *DestBuffer)
{
UINT queryIndex = 0;
char returnBuffer[MAX_PATH] = "";
int bufferSize = MAX_PATH;
DragQueryFile((HDROP)hdrop, queryIndex, returnBuffer, bufferSize);
strcpy(DestBuffer, returnBuffer);
}
|
|
|
|
|
Thanks for reply but it's not working.Even for single file.
|
|
|
|
|
|
#include <windows.h>
#include <stdio.h>
#include <commctrl.h>
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
char szClassName[ ] = "CodeBlocksWindowsApp";
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nCmdShow)
{
HWND hwnd;
MSG messages;
WNDCLASSEX wincl;
InitCommonControls();
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure;
wincl.style = CS_DBLCLKS;
wincl.cbSize = sizeof (WNDCLASSEX);
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
if (!RegisterClassEx (&wincl))
return 0;
hwnd = CreateWindowEx (
WS_EX_ACCEPTFILES,
szClassName,
"Drop a file/files onto me",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
344,
175,
HWND_DESKTOP,
NULL,
hThisInstance,
NULL
);
ShowWindow (hwnd, nCmdShow);
while (GetMessage (&messages, NULL, 0, 0))
{
TranslateMessage(&messages);
DispatchMessage(&messages);
}
return messages.wParam;
}
UINT getDroppedFilesCount(HANDLE hdrop)
{
UINT queryIndex = -1;
char returnBuffer[MAX_PATH] = "";
int bufferSize = MAX_PATH;
return DragQueryFile((HDROP)hdrop, queryIndex, returnBuffer, bufferSize);
}
void getDroppedFileName(HANDLE hdrop, char *DestBuffer)
{
UINT queryIndex = 0;
char returnBuffer[MAX_PATH] = "";
int bufferSize = MAX_PATH;
DragQueryFile((HDROP)hdrop, queryIndex, returnBuffer, bufferSize);
strcpy(DestBuffer, returnBuffer);
}
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_DESTROY:
PostQuitMessage (0);
break;
case WM_DROPFILES:
HANDLE hDrop;
int numFiles;
char fileNames[MAX_PATH];
hDrop = (HANDLE) wParam;
if (getDroppedFilesCount(hDrop) == 1)
getDroppedFileName(hDrop, fileNames);
else
sprintf(fileNames, "Multiple files...");
MessageBox(NULL, fileNames, "You dropped", MB_OK);
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
|
|
|
|
|
Thank i try to do that in this methid..
|
|
|
|
|
MsmVc wrote: but it's not working.
Are you vying for the Brevity award?
"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
|
|
|
|
|
How do I access a web service over SSL?
My client app works with "http://..." but doesn't work with "https://..." . I've managed to create a proxy class with "https://..." but calling any function gives me "SOAPCLIENT_SEND_ERROR" .
Solutions found by google tells me that I should either use Wininet function or CInternetSession but I'm reluctant to make major changes such as rewriting the proxy class generated by VS2005.
|
|
|
|
|
This could be a hack. I don't know.
Initially, my proxy class was derived from CSoapSocketClientT . So, I've changed it to derive from CSoapWininetClient instead.
template <typename TClient = CSoapWininetClient >
This solution seems to work. Also, I had to remove the web reference(*.disco, *.wsdl, *.discomap) from my solution explorer to prevent it from refreshing the proxy class file.
|
|
|
|
|
Hi,
Time ago I began to create some static libraries of functions/classes in that I frequently use in my apps. Classes that uses MFC stuff is in one library and the rest of the stuff classified in another five.
I "think" (please confirm) that having multiple library files make manteniance and changes compiling faster. Also I "believe" that Visual Studio compiler will be smart enough to NOT include all the object files of classes I don't use in my final executable.
The question, including my 2 "thinks" above, is: "using separate library files has a real benefit?"
Thanks, Mauro.
|
|
|
|
|
You are correct on both counts.
I would also suggest you convert the static libraries into dynamic libraries 'cause then you have a lot more options of either linking it implicitly or explicitly or even delay loading the DLL.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Yes. I was thinking in turning some libraries into dlls. I'm not friend of having an app of one .exe and lots of .dll, but sometimes there aren't other options.
Best regards, Mauro.
|
|
|
|
|
I am currently writing an application using C++ and MFC. For displaying the results of a certain operation, a new window is created. The window is represented by a class I created called COutputWindow. The base class of COutputWindow is CFrameWnd. I create the output window by doing the following operations:
1) Creating a new instance of COutputWindow by calling new.
2) Calling the member functions of COutputWindow: ShowWindow and UpdateWindow. Actually these
member functions are defined in the base class.
3) A define COutputWindow::OnPaint to display the results.
In my main window, I save a pointer to the output window. In addition, when the output window (window of type COutputWindow) is closed, I want the objected created by new in step 1 to be deleted. However, I cannot do this until the window is completely closed. Therefore, I believe that the pointer cannot be deleted on COutputWindow::OnClose. Therefore, where should I delete the pointer that represnets the object to the closed window.
Thanks
Bob
|
|
|
|
|
You should set the pointer to the output window to NULL in the OnDestroy callback and override the PostNcDestroy function in order to add a "delete this;" statement.
Best regards,
Mauro H. Leggieri
|
|
|
|
|
You are not doing any polymorphic operations.
Also you do not need any runtime information for creating the window.
So I suggest you go for a stack variable instead of using new and simply show/hide the window.
This will also work faster.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Or, the common refrain for large projects and pointers?
I am working with some licensed software, so some type/function names are abbreviated as <ObjName>.
void success( const <ObjName>& fir_)
{
firtemp = new <ObjName>(fir_);
std::ofstream firOut;
firOut.open( firFile.c_str(), std::ios::binary|std::ios::out|std::ios::trunc);
firOut << *firtemp;
firOut.close();
}
This is a member function of a class (it is defined inline here) which has a member variable
<ObjName> * firtemp; . firFile is a file-level const string variable.
The licensed software object <objName>> does provide an overloaded definition for the "<<" operator, and the example I'm following uses it in exactly the way I use it above to save the firtemp object to a file.
When I attempt to run this code, the firOut << *firtemp line results in a memory access violation which is fairly consistent ... it moves around very little, as in < 16 bytes or so.
One of the things i've noticed while trying to debug this error is that when I set firtemp as a watch (I'm using VS2005), and set break points at the start of the function then step through ... the value of firtemp changes wildly. Is this expected? Also, if I insert a cout statement for the value of firtemp, it does not agree at all with the value the debugger gives ... again, I'm not sure what to expect here.
Now, in the "Autos" field in the debugger, the "this" parameter has its value in red text for most of this function call ... is this normal? If not, what does it indicate? I searched online and could find no references for this simple question.
Primary Question: Is there anything obviously wrong with what I'm doing here, or is the error having to do with the licensed code/my interface to it? Any hints for trying to find the error, if it is in my interface?
|
|
|
|
|
Don't know if this will help, but why are you creating firtemp on the heap? I would try creating a stack based variable and see what is going on.
|
|
|
|
|
A good question - the example is doing it because there are other member functions that might want to access the object and there is no default constructor for it, so you can't easily have a member variable of the actual object type ... having a pointer is comprise solution.
However, for my useage this is not needed, and I did rewrite it with a local variable/stack allocation. Unfortunately I get exactly the same error. What I may not have noted in the original post is that I can definitely write to the file this attempts to write to, and I can access other member functions of the object, for instance a size() function, with no errors.
|
|
|
|
|
Ok, let's say that we have an application that supports DLL calls, and on every routine call to the DLL, the application's main handle (HWND) is passed.
Example:int __stdcall TheFunction(HWND mWnd)
Now, let's say that the application has a dialog that I want to modify (IE: Change the caption or coloring of text inside an edit box within the dialog). How would I go about gaining control of the dialog handle?
There is no "resource" file for the program, but I have already acquired the dialog ID and control identifier as well, which is located at: http://pastebin.com/ffbc560f
Dialog ID: 740
Control Identifier: 300
|
|
|
|
|
You'd need the application to cooperate, I think. It needs to give you the chance to subclass the dialog (not going to happen without the apps help, one way or another).
Even hooking into the resources won't help - the dialogproc isn't coded in the resources.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Ahh, thank you "Subclassing" is the term I was actually looking for.
|
|
|
|
|
Hi
I am unable to install platform SDK on Vista Operating System.
Each time a information bar is populated when i click on Default.htm file .
Is there any other way to Install Plateform SDK . I have used many hit and trial methods .
I have posted a query previously in the same forum . Naveen sir has suggested that Choose 'Run as administrator'.. I have also tried but same information bar which we normally see when a website tries to install some active x on computer . The information message displays 'Your security settings do not allow website to use Active X Controls installed on your computer. This page may not display correctly'.
I have clicked on this bar and done same changes in my security setting as seen in more information option .But still i am not able to install Plateform SDK..
Please tell me some way to overcome this problem..
'
|
|
|
|
|
How exactly are you trying to install the SDK and which one? I just recently installed the latest platform SDK and didn't have to do anything with default.htm, and in fact can't understand were you would have to. The download comes in ISO form and is about a 1.3GB file. You simply mount the iso with PowwerISO or something similar and run setup.exe.
Dustin
|
|
|
|
|