|
If this menu is in the menu bar, like File, Edit, View, etc. you are stuck with the window layout that comes with your locale settings, i.e. left to right. You would have to switch locals to get something different.
If this ia a popup menu you can use the TrackPopupMenu function to tell it where to popup. Or if you are creating the menu dynamically you can of course give it an initial location.
|
|
|
|
|
Set the MF_RIGHTJUSTIFY flag for the first top-level item in the menu. That'll move all top-level items on the right edge of the frame. This will look weird, since it's not the standard behavior, but there ya go.
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
"MF_RIGHTJUSTIFY " how I can set this Flag of already created menu. which Function is responsible for this settings.
This can be set when menu is designed but i want to make this change at run time.
The Actual problem is
The interface of application is in different languages. and I have to decide at run time the position of menu
|
|
|
|
|
Assuming menu is a CMenu object representing the top-level menu, this ought to do it:
menu.ModifyMenu ( 0, MF_BYPOSITION | MF_RIGHTJUSTIFY );
I haven't tested this, but it sounds right.
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
I have this code and I want to force to reload the file from the server (if not it gets it from the cache):
How can I do it?
void getMetar()
{
CString strServerName;
CString strObject;
INTERNET_PORT nPort;
DWORD dwServiceType;
CFtpConnection* pConn = NULL;
CInternetSession* m_pInetSession;
m_pInetSession = new CInternetSession("Unknown",1,INTERNET_OPEN_TYPE_PRECONFIG);
if(!m_pInetSession)
AfxMessageBox("No session");
AfxParseURL("ftp://weather.noaa.gov", dwServiceType, strServerName, strObject, nPort);
if((dwServiceType==INTERNET_SERVICE_FTP)&&!strServerName.IsEmpty())
{
try
{
pConn = m_pInetSession->GetFtpConnection(strServerName, "", "", nPort, FALSE);
}
catch(CInternetException* pEx)
{
char szErr[1024];
pEx->GetErrorMessage(szErr,1024);
AfxMessageBox(szErr);
pEx->Delete();
pConn = NULL;
}
}
else
AfxMessageBox("URL invalid");
pConn->SetCurrentDirectory("/data/observations/metar/stations/");
if(!pConn->GetFile("LEAL.TXT", "tempMet.txt",FALSE))
AfxMessageBox("No found");
}
|
|
|
|
|
I need to have a list of the tables in the current database (which I access using msado library), is there any method to access this information through the connection object?
SQL solutions depending on the database won't work since I don't know which database will be targeting (I mean I can't retrieve a recordset with the information of the user views and the name of the tables like I'd do in Oracle for example)
Thanks
|
|
|
|
|
You might want to take a look at ADOX. Check it out in the MSDN.
(2b || !2b)
|
|
|
|
|
Hi
How do i play multiple mediaplayer controls on windows NT .In Win NT i can play only one song at a time. This is automatic in Win9x .
Thanks
|
|
|
|
|
Hi!
Guess you guys think I'm pretty hung up with this VIEW thingy, but - I have to figure out a few things and one of them is:
What kind of view is for instance used in MSIE?
Bulletproof FTP?
MS Visual C++?
I discovered that CFormView might be a good thing for creating a GUI, but that does in turn give me a kind of "Dialog-like" look - and that is what I'm trying to avoid.
If I draw a button somewhere on the CVIEW, is it then hard to add actions to it?
I have a little demo i've created that draw a button in the middle of the screen... Now I just need to be able to press that button.
Am I approaching it the wrong way?
How can I THEN make a GUI in CVIEW?
(or is it not the right way?)
|
|
|
|
|
Well IE uses a HTML Window, the nearest in MFC is CHTMLView
Visual C++ uses a couple of CDialogBars and a MDI CEditView.
It all depends on the kind of app you are trying to write and what you want to achieve.
I find a CFormView is the best way to do button handling. What are you trying to achieve in a CView. You can add all the needed message handling for a button because a CView is pretty much the equivlent of a basic API Window. You might want to look at some of the API samples for this kind of info.
Michael
|
|
|
|
|
The main thing for me is to find out which ways are the easiest to draw different GUI's.
Ok, the program - and what I want from it:
I am planning on listing som text that I am searching.
The searchstring is beeing retreived from a web-server.
Then I would like to create checkbox'es next to the searchstring found.
The button is a kind of "get that file"-button.
I am trying to create a program that download files it finds on a web-page.
(links)
The reason for this is that my internetconnections sucks and browsing takes ages. (My ISP is having a lot of trouble and I can't wait for them to get their act together and find out what's causing the slow connections)
So when I'm looking for files on web pages (source code for instance) i have a lot of idletime waiting for the browser to show the web page.
So I need a program that can find the files I need, and what better way is it than to create it yourself?
I am currently looking at some source downloaded from this site, called Regiontracker.zip.
It has about 10% of the things i'm looking for - but I might still get some pointer off of it...
|
|
|
|
|
|
I discovered that CFormView might be a good thing for creating a GUI, but that does in turn give me a kind of "Dialog-like" look - and that is what I'm trying to avoid.
In that case, doc/view probably isn't the right thing for you to use. A plain window that you draw yourself would be easier to manage, something like WinAmp. If you want to stick with the standard controls, you'll get the standard look (which really isn't all that horrible, it is standard after all).
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
Hi,
In order to find an item in a ListCtrl i am using Find method of ListCtrl
My code snippet is :
CString sText="something";
LVFINDINFO info;
info.flags = LVFI_PARTIAL | LVFI_STRING ;
info.psz =(LPCSTR) sText;
int nIndex = FindItem(&info);
//it is always returning 0 even not -1 o indicate that the item is not in the list.I can see my item with the text in ListView but
It can not find the item...
Any ideas that can put some light...
with greetings from Germany
Özgür
|
|
|
|
|
If FindItem returns 0, first item in your list contains 'something'. Item numbers are 0-based.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I'm trying to learn C++ and I've a couple of basic questions about strings I don't know, could somebody help me ???
Case 1.
I've a CString object in my application and I've a function which uses that CString but doesn't modify it (just get the value). Which is the best way to pass it ?? Should I pass it as CString, CString*, const char* ???
Case 2.
The same as above but now I want to modify the value.
Could somebody help me with that ?? and please tell me why is better one option than another.
Thanks in advance.
|
|
|
|
|
void NonModifyFuncion(const CString &sString);
void ModifyFuncion(CString &sString);
(2b || !2b)
|
|
|
|
|
1) There is something I still don't understand:
I thought that If you declared a variable of type const, it was stored in .rdata section for constant data vars which it is better than in other sections (but only for integral data types, this is why I considered const char). By the other hand, const CString is stored in .rdata but also the object is stored in .bss for non constant data types.
What am I saying wrong ?????
Thanks for everything.
|
|
|
|
|
1) const CString&
2) CString& or CString* depending on your preference. I myself would use a CString* because parameters that are going to be modified are, by convention, passed as pointers as a holdover from C. Then again, that's just my style.
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
1) There is something I still don't understand:
I thought that If you declared a variable of type const, it was stored in .rdata section for constant data vars which it is better than in other sections (but only for integral data types, this is why I considered const char). By the other hand, const CString is stored in .rdata but also the object is stored in .bss for non constant data types.
What am I saying wrong ?????
Thanks for everything.
|
|
|
|
|
Maybe I don't understand your question, but keep in mind that it is only global data that is stored the the .rdata and .bss sections (variables declared with global scope, externs and static class members). All other variable are stored on the stack (well, except those explicitly allocated on the heap with new or malloc). So your function parameters will be passed on the stack. The constness only tells the compiler that it should not allow the function to modify the object - the object passed during program execution does not have to be declared const. In other words, you can pass a non-const CString as a const CString& parameter, but you cannont pass a const CString as a (non-const) CString& parameter.
I hope this was what you asked.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Thanks, it was what I was asking and I have understood it.
|
|
|
|
|
Thanks, it was what I was asking and I've understood it.
|
|
|
|
|
System: winnt 4 with two soundcards
How can i control on which soundcard a wave-file is played?
Is it possible to do it with the multimedia-sdk?
thanks to all who try to help me
Andreas
|
|
|
|
|
I have a button (owner drawn) which has a dynamic image on it. The image can be either a HBITMAP or HICON. It works great for normal styles, but I would like to grey the image when the button is disabled (same way it is done on a toolbar when a button is disabled). Does anyone know how to convert an HBITMAP and/or HICON image to disabled image.
Any help or pointers appreciated, thanks.
---
Better to be silent and thought the fool, than to open your mouth and prove it!
|
|
|
|