|
I loaded an object in MFC and am geting problems in displaying the object moving slowly!! in the onpaint function, i inserted a while loop and it runs too fast!! tried getch(),to no avail. Can i use setdelay() for such a purpose? any suggestion?
|
|
|
|
|
You can try Sleep(1000);
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
|
Hello,
In my MDI application, i have two child windows and a child dialog Box. I can switch between any two child windows and i have event handler for toggling.
Following is the code-
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//..............
ON_COMMAND(IDM_TOGGLE_WINDOW, OnMenuToggleWindow)
//..............
END_MESSAGE_MAP()
void CMainFrame::OnMenuToggleWindow()
{
assert(isTerminalMode() || isDataMode()|| isFlightAnalysisMode());
CMainFrame::ActivateFrame(SW_SHOWMAXIMIZED);
::PostMessage(m_hWnd,SIZE_MAXIMIZED,0, 0);
if (isTerminalMode())// child window
//setDataMode();
setDataMode(); //child window
else if (isDataMode())
setFlightAnalysisMode(); //dialog Box (child)
else if (isFlightAnalysisMode())
setTerminalMode();
}
Now, all the windows are working properly but as soon as i switch to another window, everything stops working. I can still toggle windows, but
data doesn't get refreshed.
What should i do?
|
|
|
|
|
Hi, I asked earlier about some help with a problem I am having.
I have a dialog based application in which has a Browse for directory call. Thats fine, I have that implemented, when the user selects the folder they want my program to scan it returns the folders path as szFolder.
I have a list control, m_contentlist, which I want to display the contents of szFolder in (directory selected)
Can someone please post code rather than links? That would be very helpful.
Thankyou
Ashman
|
|
|
|
|
Ashman wrote:
Can someone please post code rather than links? That would be very helpful.
Here's a starting point:
CFileFind ff;
ff.FindFile(szFolder + ???);
while (...)
{
ff.FindNextFile();
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How to get file name from a given filepath without using winAPI for both windows and mac env?
|
|
|
|
|
|
#include <string>
std::string strPath = "c:\\blah\\blahblah\\file.txt";
int pos = strPath.find_last_of("\\");
std::string strFile = strPath.substr(pos + 1);
That should do it.
-- Rocky Dean Pulley
|
|
|
|
|
sorry, that first line is supposed to be:
#include <string>
I forgot to remove the <'s as HTML tags.
-- Rocky Dean Pulley
|
|
|
|
|
Hi..
I would like to know how to go about porting a GDI based application from 32bit to 64bit, to run on IA64 (orAMD64) processor with windows xp 64bit beta..
I am aware 32 bit application uses thunking to run on 64 bit OS, but the requirement is to make the application 64 bit complaint. Also, the pointer size is 64 bits and there's no change to be done to the existing data type..
The application to be built with the Beta version of 64 bit libraries..
With this I had proceeded, Let me know If I need to take care of any more thing..
Thanks,
TssP
|
|
|
|
|
TssP wrote:
IA64 (orAMD64) processor with windows xp 64bit beta
WinXP 64-bit beta does not run on the IA64 architecture, only on the AMD64.
If you cast a pointer to an integer at any stage, use the ULONG_PTR data type, which is guaranteed to be the same size as a pointer, no matter what platform you're compiling for. Also use SetWindowLongPtr() and GetWindowLongPtr() instead of SetWindowLong() and GetWindowLong() for the same reason. There are other things to watch out for, but you'd best go through each method call and make sure it's going to work.
See here[^] for a few more things to watch out for.
Basically, check that any variable size changes are not going to cause you any problems.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
hi I have a project that has two views, the major view and a pane that shows info about current view, I derived main view(SDI project) from CScrollView(it needs scrolling support) and then used a CSplitterWnd to create a splitted view, the second splitted view is associated with a dialog
in CMainFrame::OnCreateClient as this:
m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CInfoView),CSize(700,200), pContext);(CInfo View is my dialog class)
I have two questions, first how can I get a pointer to the dialog that currently associated with that view in My CDocument class so I can update my controls data from there.
second, how can I change dialog associated with that view on the fly(when a user clicks on some parts of the main view controls should change completely in the info pane) one way would be to use the same dialog but Show/Hide different controls according to circumstances but I guess this is not the best way, it leads to a very crowded dialog, that is not nice at least in design time, isn't it better to associate the same view with different dialogs according to circumstances.
thanks
|
|
|
|
|
How to fix the height of the 'last row' in the splitter window?
I've been agonizing over this for hours now and i can't find the right solution to this problem. Does anyone have the answer?
It's easy if it is not the last row by using splitterWnd.SetRowInfo(...) but how to do it for the last row?
Thanks in advance.
www.dejavusoft.com
|
|
|
|
|
I have an MDI application and serializing it as text. The problem is, when I open the saved files, there are "Entry Root" word and other
kind of texts. What should I do to save as pure text?
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
What does the Serialize() method currently look like?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi, I'm using C++ to create an extended sotred procedure that calls a manged DLL that calls a web services
When I come to translating the stream of parameters passed from SQL into variables I get an access violation error.
can anyone see why (I am not a C/C++ programmer, so I'm sorta out on a wing here)
srv_paraminfo(srvproc, 3, &bType, &uMaxLen, &uLen, NULL, &bNull);
BYTE* Data = new BYTE[uLen];
memset(Data, '\0', uLen);
srv_paraminfo(srvproc, 3, &bType, &uMaxLen, &uLen, Data, &bNull);
char * temp;
temp = (char*)Data;
_bstr_t DateTendered;
DateTendered=_bstr_t::_bstr_t(temp); <- this line causes error
any help would be great
|
|
|
|
|
I don't know too much about _bstr_t, but maybe it has something to do with the copy constructor. Try changing this:
_bstr_t DateTendered;
DateTendered=_bstr_t::_bstr_t(temp);
to this:
_bstr_t DateTendered(temp);
I don't know if it will help or not, just a possibility, the rest of the stuff looks ok to me, but it is only 6:45 and I'm half awake
-- Rocky Dean Pulley
|
|
|
|
|
Yip that worked fine, thanks a lot
|
|
|
|
|
Okay, I'm having this problem and don't want to have to do too much in order to get it to work properly. I have a wizard set up using CPropertySheet. There is a property page that is shown that begins processing information and displaying its progress on the shown CPropertyPage, but when the user presses cancel I want the overrided CPropertyPage method OnCancel to be called so it can tell the CPropertySheet parent to switch to the appropriate error page (lets say when its processing and the user presses cancel, I want it to kill the thread processing the data (got it to do that), and switch pages automatically telling the user that the processing wasn't completed because it was canceled). I know that when I click the "Cancel" button on the sheet that it fires the OnCancel method, but even if I prevent the following statement from executing, it still closes the window:
CPropertyPage::OnCancel();
How do I stop the sheet window from closing when I press Cancel and do what I tell it in my overrided OnCancel method?
|
|
|
|
|
Is it possible to let a user draw his own button at runtime? I mean to say,that the button size be varied with its position also at runtime.
Actually,my project work needs to make a toolbar analogous to "Micrsoft Paint"'s toolbar in which there will be button tool which a user can use to make a button in his workplace.It will be more suitable if the button is circular rather than rectangular as seen normally in VC++ .
|
|
|
|
|
Yes, it is possible. If you want to draw your own type of button that's circular that's possible too. Don't expect code here though, that's pretty much beyond the scope of a forum thread, just read up on owner draw buttons for the circular button question. For resizing the button, you will need to just code some way for the user to resize it, put it in some custom view or something and handle the mouse events, you can call MoveWindow() to resize the button.
-- Rocky Dean Pulley
|
|
|
|
|
In Win32 is there an easy way to query the top n windows on the screen by Z-Order and get their handles?
Joel Holdsworth
Wanna give me a job this summer?
Check out my online CV and project history[^]
|
|
|
|
|
Have you tried using EnumWindows()? I can't remember off the top of my head whether or not it goes by Z Order, but I think it may.
-- Rocky Dean Pulley
|
|
|
|
|
Try Combination of FindWindow and FindWindowEx .
here is small piece of code,please Check Is it suit your requirements.
BOOL NMPEnumWindows(CStringArray *arWindowsName,CPtrArray *arhWnd)
{
<font color=#008000>
HWND hWnd,hWnd1=NULL;
CString Str;
char lpString[201];
<font color=#008000>
hWnd=::GetDesktopWindow();
<font color=#008000>
do
{
hWnd1=::FindWindowEx(hWnd,hWnd1,NULL,NULL);
<font color=#008000>
::GetWindowText(hWnd1,lpString,200);
Str.Format("%s",lpString);
<font color=#008000>
</font>
If((::IsWindowVisible(hWnd1)==TRUE)&&(Str!=""))
{
arhWnd->Add((HWND)hWnd1);
arWindowsName->Add(Str);
}
}while(hWnd1!=NULL);
return TRUE;
}
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|