|
Ummmm, nooooo. I'm using both.
In any case, one problem was that I had the stdafx include INSIDE the #ifdef. This prevented the definition of _MFC_VER in time to be evaluated, so it appeared to be ignored, when if fact, it wasn't defined in time.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
PrabhuDev wrote: is it possible to make a floating control bar to behave like a modal dialog?
Yes. Subclass the control bar and provide a Message loop . Message loop here means the one like in WinMain . This should make your control bar modal.
|
|
|
|
|
PrabhuDev wrote: can u please give me more details regarding this?
Thanks and regards,
Sure. Look up this article by Nish. You will understand I meant.
In this article he talks about how to create modal windows. The same technique will apply to control bars too.
Modal Inputbox[^]
|
|
|
|
|
PrabhuDev wrote: EnableWindow(FALSE);
ShowControlBar(&g_DemoBar, TRUE, FALSE);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
EnableWindow(TRUE);
Why are you writing this message loop here and why are you calling EnableWindow(FALSE) .
You should write the message loop inside the ShowControlBar function. The message loop should come just after the Control bar is shown. There is no point in writing the message loop here.
There is no need to call EnableWindow anywhere. Look at what nishant has done.
|
|
|
|
|
Hi
I want to create a Russian dialog, I set the dialog resource language to Russian, but when I paste a Russian word into a static text all chars change to questuion mark!
(I've added Russian language to my Windows Languages)
I use Visual Studio 2003, MFC Project(Unicode) and Windows 2000 Professional.
What I must to do?
Thanks
-- modified at 6:42 Sunday 5th November, 2006
|
|
|
|
|
|
Your project must be either UNICODE or MBCS. Also you might want to check you are using a Russian compatible font to display the characters.
|
|
|
|
|
Project is Unicode and I used a Russian compatible font, but it does not work
|
|
|
|
|
Could you show us how you are setting the text to the control?
|
|
|
|
|
I'm not much of a mathematician, so hopefully somebody knows of an easy way to do what I want. Lets say we have a rectangle { 0,0,800,600 }, within that rectangle is another { 200, 200, 400, 300 }. How is it possible to calculate the position and size of the largest rectangle that can be created in the remaining space. In this case it would be { 0,300,800,600 }.
This example is very simple, I would actually have up to 10 smaller rectangles to compensate for. If you are wondering why, I want to calculate the best place to draw text in between the various child controls on a window.
|
|
|
|
|
In general there are four possible rectangles to consider, the upper one, the lower one, the left one and the right one. If the coordinates of the outer rectangle are (ol, ot)-(or, ob) (“o” for outer and “l”, “t”, r” & “b” for left, top, right and bottom, respectively) and the coordinated of the inner rectangle are (il, it)-(ir, ib) are the coordinates on the inner rectangle (“i” for inner) the four largest rectangles that fit in the remaining space are:
Top:
(ol, ot)-(or, it)
Bottom:
(ol, ib)-(or, ob)
Left:
(ol, ot)-(il, ob)
Right:
(ir, ot)-(or, ob)
All that remains is to calculate their areas and choose the biggest one.
[ADDED]
I just noticed you want many inner rectanges and not just one. This makes it harder. Obviously my method assumes just one.
Steve
|
|
|
|
|
I took basically the same approach, except that I only calculated the space to the left and right of the inner rectangle. It serves the window at hand which has the appearance of a tool bar with buttons to the left and right and a large space in the center. But I ran into a few problems while trying to calculate vertiacal space at the same time as horizontal space. Though through your explanation I can see how it can be achieved.
Due to the nature of the program, I think it best to leave this particular method as virtual. Thanks for your input.
|
|
|
|
|
Excellent. Thank you. I was having trouble finding that wizard, I had only seen it via the context menu on the dialog, and that for some reason did not have all the base classes.
|
|
|
|
|
Quite a few of the articles on this site instruct to do something similar to the following with VS7:
Derive a new CListCtrl based class (here CMyListCtrl). In the VC IDE, this is as simple as selcting 'Add Class...' from the MFC Class wizard then, in the new class dialog, naming the control and selecting CListCtrl as the base class in the drop down list.
However I am using VS2005(VC++8) and the only base classes listed in the wizard are CDialog, CDHtmlDialog, CFormView, COlePropertyPage, and CPropertyPage. I ran into this problem with a CTabCtrl article also. The code compiles fine from the article though, I suppose i'm missing something simple.
Thanks!
|
|
|
|
|
Have you created the application as a standard MFC application?
File->New->Project select MFC in left pane, select MFC app. in right pane. Type solution name and OK.
Click finish to accept standard MFC settings for this test.
Select the "class" tab in the solution explorer, and right click the application name at the top. Select Add->Class from the drop down list. Ensure MFC is selected in both panes and click Add. Click the pull down arrow on the Base Class: combo box, and you should have all the classes available. If not there is something wrong with you installation.
Hope that is what youare trying to find out.
|
|
|
|
|
Hello
Does anyone know how i can use "FOR XML" expilicit command with ODBC in Visual C++ 6.0?
thx
-- modified at 20:39 Saturday 4th November, 2006
|
|
|
|
|
I'm asking this question because i tried many times to find a way to change connection parameters such as times out , number of retries , login , password every thing when the user intend to do so when i found a function called RASdialup() and other functions and by filling the RASDIALPARAMS sructure and after the excution of prog finally and unfortunatly i found RAS dial up not useful since the adsl modem has been used, after i decided to look back to WININET library .. another problem found is we can only change the 'PROXY' authentication :
//hOpen is the HINTERNET handle created by Internet Open
//strUsername is a string buffer that contains the proxy username
InternetSetOption(hOpen, INTERNET_OPTION_PROXY_USERNAME,
strUsername, strlen(strUsername)+1);
//strPassword is the buffer that contains the proxy password
InternetSetOption(hOpen, INTERNET_OPTION_PROXY_PASSWORD,
strPassword, strlen(strPassword)+1);
the second flag|parameter INTERNET_OPTION_PROXY_USERNAME can be changed only to INTERNET_OPTION_USERNAME but WITH condition calling InternetConnect function and return a handle hConnect, (for my point of view i want the first flag to be NULL to indicate that we can change the DEFAULT SETTINGS).
Note that there is a way to use INTERNET_OPTION_PER_CONNECTION_OPTION as a customized option the default settings changed well and we can use LAN connection options but without authentications change!! :
BOOL SetConnectionOptions()
{
INTERNET_PER_CONN_OPTION_LIST list;
BOOL bReturn;
DWORD dwBufSize = sizeof(list);
// fill out list struct
list.dwSize = sizeof(list);
// NULL == LAN, otherwise connectoid name
list.pszConnection = NULL;
// set three options
list.dwOptionCount = 3;
list.pOptions = new INTERNET_PER_CONN_OPTION[3];
// make sure the memory was allocated
if(NULL == list.pOptions)
{
//return FALSE if the memory wasn't allocated
return FALSE;
}
// set flags
list.pOptions[0].dwOption = INTERNET_PER_CONN_FLAGS;
list.pOptions[0].Value.dwValue = PROXY_TYPE_DIRECT | PROXY_TYPE_PROXY;
// set proxy name
list.pOptions[1].dwOption = INTERNET_PER_CONN_PROXY_SERVER;
list.pOptions[1].Value.pszValue = "http://proxy:80";
// set proxy override
list.pOptions[2].dwOption = INTERNET_PER_CONN_PROXY_BYPASS;
list.pOptions[2].Value.pszValue = "local";
// set the options on the connection
bReturn = InternetSetOption(NULL,
INTERNET_OPTION_PER_CONNECTION_OPTION, &list, dwBufSize);
//free the allocated memory
delete [] list.pOptions;
return bReturn;
}
If still not understand ignore it and help for how to change all default connection settings with any type of connection (LAN/ADSL/PHONE DIAL UP) ... I am really stuck
Anyone who considers arithmetical methods of producing random numbers is, of course, in a state of sin.
John von Neumann
|
|
|
|
|
I've seen some application that customise buttons on the title bar of a window. There are tutorials on CodeProject about this. My question is, although I can customise a button on my own application title bar, is there a way I can do this globally for all windows? I want to write an extension to add a button/function to every window/application.
Can anyone point me in the right direction of where to begin and any decent reference material?
http://www.asura.co.uk
|
|
|
|
|
The buttons on a title bar are not actually buttons, they are just regions in which you can click. To install a global button you would have to globaly hook the WM_NCPAINT then calculate the position for each window. I can't imagine it being too difficult, but you would have to take into account the window style for each window.
|
|
|
|
|
Thanks for the info.
I assume my application needs to be a 'shell extension' COM object as I want my application to be integrate into all visible windows/applications without manually running anything. I'm new to that area of programming and from what I gather there is very little documentation (either that or I'm not using the right search keywords )
... can anyone offer any advice?
http://www.asura.co.uk
|
|
|
|
|
http://img115.imageshack.us/img115/2114/erroruq1.jpg[^] what is wrong with my aplication? when it runs on my pc everything is alright but when i try to run it on others PC's it gives an error like that above.
I am running on Windows XP SP2 while others i think on Windows XP no SP or SP1... but there is no difference between sp1 and sp2 at least for applications running, i think...
any ideas how to fix that? maybe compilator settings are wrong?
thank you in advance for help
|
|
|
|
|
Are you using manifest files? I had a similar problem some time ago when using them.
This[^] may be of some help to you.
|
|
|
|
|
|
if found that i need to install somewhat dll package to another PC... but thats useless at least in my case. I need standalone executable like Skype.exe and it doesn't matter how big it would be...
i didn't found anything useful about how to make standalone application. I have linked ATL libraries staticaly but thats not enought...
so how to make my application standalone?
|
|
|
|
|
you didn't answer my question. If you are using a manifest file, then you are forced to include the correct version of the dll's with your app. Try disabling the manifest.
|
|
|
|