|
try this then
dlg.m_ofn.lpstrFilter = "C++ Source Files (*.cpp;*.h)|*.cpp;*.h|All files (*.*)|*.*||"
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
|
The second \0 is put implicitly by the compiler.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hmm, you're right. I always specify the filter using the CFileDialog constructor, so I use the "|" and "||" delimiters in the filter string.
|
|
|
|
|
hi friends,
i wrote one protocal...facing problem...please help any bogy
before Lisening i am dedicating socket p.AsyncSelect(FD_ACCEPT);
i am Accepting All the Connections....
next i want to do Sent and recieve repately....but after Accepting Connections its not going sent..
i am using CAsyncSocket(OnAccept,OnSent,OnRecieve)...
|
|
|
|
|
Quick tip: Leave AsyncSelect() alone, most time you don't need to play with these values.
Socket objects inherit their notification event settings from the listening socket or more precisely from the socket that accepts them. If you use any of the notification handler OnSent/OnRecieve/OnClose in your socket objects you need the corresponding FD_WRITE/FD_READ/FD_CLOSE events[^] too. Until you do some superduper-fine-tuning, just stick with the defaults.
Hope this helps.
/M
|
|
|
|
|
I have a dialog in my application. When the application starts the dialog size should be the the system size. It should occupy the full screen size automatically. How can i do this?
|
|
|
|
|
One way is to use GetSystemMetrics() with SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN to retrieve the screen dimensions, then use SetWindowPos() to set your dialog to that size.
|
|
|
|
|
Small example:
UINT width = GetSystemMetrics(SM_CXSCREEN);
UINT height = GetSystemMetrics(SM_CYSCREEN);
SetWindowPos(hWnd, HWND_TOP, 0, 0, width, height, SWP_NOZORDER | SWP_SHOWWINDOW);
|
|
|
|
|
Just a comment: If you don't use SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN in the GetSystemMetrics() calls, on a multiple-monitor system only the primary monitor's dimension is obtained. It's hard to tell whether the original poster wanted to use the primary monitor, or the whole desktop, though.
|
|
|
|
|
ohh yeah, if author will use a multiple-monitor system, you're right of course
|
|
|
|
|
hai all . I am using a dialog based MFC application. How will I get the value of hwnd?
|
|
|
|
|
By default CWnd defined in afxwin.h. You should find same definition CWnd* m_pMainWnd;
|
|
|
|
|
hi I am trying to use it in InitDialog() but they are showing undeclared identifier m_pMainWnd
I saw this variable in the afxwin.h which is included by the StdAfx.h
|
|
|
|
|
What version of Visual Studio do you use? If 2010, there is another structure of default generated code. Anyways check that stdafx.h is include in your header file
|
|
|
|
|
hai , I am using this code in InitDialog()
int width=GetSystemMetrics(SM_CXSCREEN);
int height=GetSystemMetrics(SM_CYSCREEN);
SetWindowPos(AfxGetApp()->m_pMainWnd,0,0,width,height,SWP_SHOWWINDOW);
It is not working.
|
|
|
|
|
hey i got it .
I chaged the last parameter to SWP_NOZORDER|SWP_SHOWWINDOW .then it was working.
Thank u
|
|
|
|
|
|
On some multiple-monitor systems this only maximizes the window to one of the monitors, which may or may not be what the original poster wanted.
|
|
|
|
|
As the answers aboves, I want to ask a question for more. That is:
How can you let the buttons or text controls to suit the screen when the dialog fit the different screen size?
In another word, the buttons in dialog will stay unmove if you just let the dialog fit the screen, that will make the whole dialog look grotty.
Thanks, I wonder if I describe the question clearly.
|
|
|
|
|
At first you should determine controls position and form size, then on WM_SIZE event change position of controls that will depends on width and height of your form.
|
|
|
|
|
which functions can i use to do this?
|
|
|
|
|
So the simplest way to use GetClientRect ... and example
RECT clientScrRect;
GetClientRect(hWnd, &clientScrRect);
Instead hWnd write HWND of your controls. Finally you got coordinates of your controls.
|
|
|
|
|
Hello everyone,
I'm hoping someone can point me in the right direction with a little project I'm working on!
I have a collection of third-party C-style DLLs that I am using in my own UNmanaged C++ DLL. My goal was to wrap these functions into my own DLL and then write a VB6 COM based DLL to wrap my C-style DLL so that I can use these functions in a VBScript ASP page. Whether or not this makes sense, I've done this before and had good success, so I was going to try it again.
However, the third-party C-style DLLs are returning Unicode strings, and I actually NEED to support multiple languages. When I pass these Unicode strings to the VB6 app, they'll be converted to the ANSI character set for the locale of the IIS server (i.e. char* rather than wchar_t*), so presumably they will be converted to some Western European ANSI character set. I'm not sure how the .ASP page will handle passing the strings to/from the VB6 COM DLL wrapper, but I'm guessing it will be a straight Unicode call, so there is probably not a conversion problem there, but maybe I'm wrong about that!
Maybe I could handle the conversion of Unicode->ANSI (wchar_t -> char) myself, using the appropriate codepage for the user's language, and there also seem to be some workarounds using VarPtr or StrPtr to pass Unicode between VB6 and C++.
At this point, I'm pretty sure I could hack out some solution, but I was really looking for an elegant/"correct" way to handle this. I don't have much experience with the .NET solutions like ASP .NET, but I would be open to writing the small web page that I will need as a frontend in whatever language/framework is most appropriate.
Basically, I need to have a web page that is capable of calling these third party unmanaged C++ DLLs and to receive and display the results on a web page in multiple languages. Is (C++ DLL->ANSI)<-->(ANSI->Unicode->VB6 COM DLL->Unicode)<-->.ASP an appropriate way to go? Is there a better way than wrap my C++ DLL in the VB6 COM DLL? Should I use a .NET wrapper (using PInvoke, from what I've seen) on the third-party DLLs and use ASP .NET to call the managed .NET wrapper directly? Not sure exactly how to do that, so if that's a good choice, any pointers appreciated.
Thanks for your help!
Corey
|
|
|
|
|
Just a general piece of advice: if at all possible, stay with UNICODE. There are 'round trip' problems with multiple string conversions.
|
|
|
|