|
well, in VS.Net, any windows api constant that I hover over, I get the value. Other than that:
1. put a breakpoint on your code, hover over the constant at run-time ||
2. put the constant in the watch window ||
3. put the constant in a sprintf() or TRACE macro to output the string ||
[edit] 4. right-click on the constant and choose "goto definition" [/edit]
int i = 2, x = 2;
int j = x + y;
sprintf("%d",j);
4.7388937 ???
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
multiple property pages on one sheet.
i need hide or show one page according to different cases without changing the page's index.
how to do that?
includeh10
|
|
|
|
|
Do you want the tab order the same, or must the index number remain the same (and those of the other tabs)? The latter, to the best of my knowledge, is not possible. For the former, it's probably easiest to remove all of the tabs (using RemovePage) and then add them again (using AddPage), with the page in question on a conditional statement:
void CMyDlg::OnBnClickedShowPgTwo(void)
{
UpdateData();
ResetPropPages();
}
void CMyDlg::ResetPropPages(void)
{
// remove pages - this removes all pages regardless of order or which are showing
while(m_wndPropsht.GetPageCount())
m_wndPropSht.RemovePage(m_wndPropSht.GetPage(0));
// add pages again (order important)
m_wndPropSht.AddPage(&m_wndPg1);
if(m_bShowPg2) m_wndPropSht.AddPage(&m_wndPg2);
m_wndPropSht.AddPage(&m_wndPg3);
}
If you've derived the CPropertySheet class you can do it from within that (no need for "m_wndPropSht."). It doesn't matter if you're showing the property sheet at the time or not, though you need to think about which page to show after resetting, particularly if you were showing the removed page.
|
|
|
|
|
does the code work?
as i tested, if all pages are removed from sheet, the sheet dispears - adding pages again doesn't work.
but i fixed my problem by your idea
thx
includeh10
|
|
|
|
|
sorry, yes, when I did it I always kept the first page which I didn't need to remove.
|
|
|
|
|
Hi all,
How can i know which version of service pack in installed for MSVC6.0 on my machine. and where i can get the SP3 for the MSVC60?
this is because,I am geeting similar errors which are mentioned in Q191626.
Thanks in advance,
Abhi Lahare
|
|
|
|
|
Abhi Lahare wrote:
How can i know which version of service pack in installed for MSVC6.0 on my machine.
How about:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\6.0\ServicePacks
Abhi Lahare wrote:
and where i can get the SP3 for the MSVC60?
Have you tried http://msdn.microsoft.com?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
If you are talking about the visual studio service pack, you can open visual basic and select Help>About. It shows the service pack version but if u have only visual c++ installed, I have no idea
Regards
Pradeep
Between the great things we cannot do and the small things we will not do, the danger is that we shall do nothing
|
|
|
|
|
Perhaps you meant to reply to Abhi Lahare.
david_gilmour wrote:
If you are talking about the visual studio service pack, you can open visual basic and select Help>
Why would I want to open VB to know what service pack is installed?
david_gilmour wrote:
...u have only visual c++ installed, I have no idea
Did you know read my reply in its entirety?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Help:
I'm trying to write an application on Visual Studio .NET 2003 that uses the Video for Windows AVIFile methods to read an AVI DV file and grab some frames from it. It's been working fine, except I can't seem to access the whole of a larger file. If I use AVIFileInfo after AVIFileOpen then the length of the file given (in frames) is smaller than the actual length. If I then open the video stream and use AVIStreamLength I get the actual file length. However, if I try to use AVIStreamGetFrame to extract frames it returns NULL for any requests for frames beyond the length given with AVIFileInfo!
Some messing about has shown me that the cut-off point seems to be around the 1GB mark(approx 4m45s for DV). If I encode using a different scheme (say, Cinepak codec) then it displays well beyond the 5m mark (although the file I checked this on was still less than 1GB, so I need to generate a bigger file to find if the problem resurfaces with a different codec - will do this overnight).
I can't find any reference anywhere to a restriction with reading avis with AVIFile, but can't think what else the problem could be. As far as I know both AVIFileInfo and AVIStreamLength extract data without the use of a codec so it's not a problem with the specific codec that I'm using. Having said that, I know that Video for Windows is a bit outdated and I should really be using DirectShow, so maybe it's because the software is too old...
Has anyone else had this problem or have any ideas?
jOP
|
|
|
|
|
Hi All!
I am getting debug assertion error exactly at the fourth time i open Webbrowser Control, consistently, everytime. CAN ANYONE HELP?
Any help on this regards will be appreciated !
I have two components, one is a MFC Application and the other is a Dll. I have a Webbrowser control in the dll, that is accessed by the MFC App. The following code calls the Webbrowsercontrol, which is in the dll, by the foll code:
"CWebDialog* wb;
wb = new CWebDialog();
wb->DoModal(); "
This code calls the Webbrowser control cpp, in the dll, whose Initdialog has the foll:
BOOL CWebDialog::OnInitDialog()
{
USES_CONVERSION;
CoInitialize(NULL);
try
{
hf_WriteLog("ONINITDLGWEB");
COleVariant vaURL(m_strURL);
((CWebBrowser2*)GetDlgItem(IDC_EXPLORER1))->Navigate2(vaURL, NULL, NULL, NULL, NULL);
hf_WriteLog("NAVIGATED");
VariantClear(&vaURL);
CoUninitialize();
CDialog::OnInitDialog();
}
This throws an exception, every fourth time. Is that a problem with the memory allocation of the dll.. or anything, someone could help????????
Regards
angello6
|
|
|
|
|
Hello
Can anyone please help me to write a multiple column combo box program in VC++.
Thanks
Madhavi
|
|
|
|
|
My application has to launch Notepad opening within it a file produced by itself.
I've tryed with the following code but it doesn't work correctly. Notepad is open but the file is not open within it. By the way, the same command launched within cmd.exe works fine.
CString l_cstrApp = _T("C:\\WINNT\\Notepad.exe");
CString cstrCommandToLaunch. = _T("C:\\MyFile.txt >> Notepad.exe");
CreateProcess(l_cstrApp.GetBuffer(0),
l_cstrCommandToLaunch.GetBuffer(0),
NULL,
NULL,
FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&l_StartupInfo,
&l_ProcessInfo);
Can someone tell me how to solve this problem ??
|
|
|
|
|
l_cstrApp = _T("C:\\WINNT\\Notepad.exe C:\\MyFile.txt");
|
|
|
|
|
or better way to use
ShellExecute
ShellExecute(NULL,"open","Notepad.exe","filename.txt",NULL,SW_SHOWNORMAL);
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
"C:\\MyFile.txt >> Notepad.exe" does not work. Use the following:
CString l_cstrApp = _T("C:\\WINNT\\Notepad.exe");
CString l_cstrCommandToLaunch. = _T("C:\\WINNT\\Notepad.exe c:\\file.txt");
ARSALAN MALIK
|
|
|
|
|
OK ! Now It works!
Thanks a lot to all.
|
|
|
|
|
I want to make a program that administrates some computers in a network and I need to do a client server aplication. The computer server has a server program which accepts connections from the computers in the network. After a computer connects i create a thread for that certain socket and ip.
In order to send info to a computer so I can reveive something I have to do it in that thread so I need some way of storying some string variables somewhere from where they can be read. I don't think registry would be a good idea because I did this and after a while the registry fails to open the certain key I don't know why . . . I know it can be done with some mutex objects or something like this. Can someone give me a piece of code on how variables can be read.
Thank you.
gabby
|
|
|
|
|
I want to use API TransmitFile to build a C/S structure ,who can give me an example.I have written a program but client program has bug,client codes as below:
UINT ClientThread(LPVOID lv)
{
SOCKET s=(SOCKET)lv;
CFile f;
bool IsOpen=false;
char buf[1024*128]="";int count=0;
while (true)
{
buf[0]='\0';
int ret=recv(s,buf,sizeof(buf),0);
if(SOCKET_ERROR == ret)
{
CString s;
s.Format("%d",WSAGetLastError());
AfxGetMainWnd()->SetWindowText(s);
break;
}
else
{
CString str(buf,ret);
int i=str.Find(':');
if(-1 != i)
{
if(f.Open(str.Right(str.GetLength()-i-
1),CFile::modeCreate|CFile::modeWrite) == 0)
break;
IsOpen=true;
}
else if("FileTranferOver" == str)
break;
else if(IsOpen)
{
try
{
f.Write(buf,ret);
}
catch (...)
{
str.Format("%d",GetLastError());
MessageBox(NULL,str,"Error",MB_OK);
}
}
else
continue;
count+=ret;
}
}
if(IsOpen)
f.Close();
CString str1;
str1.Format("%d",count);
AfxGetMainWnd()->SetWindowText(str1);
return 0;
}
|
|
|
|
|
I am having a MFC Dll.
The settings are as follows
Use MFC in a Static Library
In Code Generation : Debug Mutithreaded DLL.
The error i am getting is
uafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___wargv
uafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
But when i change the Code generation option to
Debug Multithreaded,
i dont get any Link errors.
What is the difference and is it OK to have this option for a MFC dll.
Yuvaraj N
|
|
|
|
|
in my app, i resize property sheet to max size (SW_SHOWMAXIMIZED), but when i resize property pages of the sheet, they are not resizable.
do you know how to resize property pages??
thx
includeh10
|
|
|
|
|
Paolo Messina has written an article on this
http://www.codeproject.com/property/resizableproperties.asp[^]
Boiled down to basics, what you do is in your property sheet's OnSize handler is call GetTabControl() to get the tab control, resize the tab to the size you want, then call CTabCtrl::AdjustRect to get the size of the tab's client area. Then resize the active page to that area.
void CMySheet::OnSize(UINT nType, int cx, int cy)
{
CTabCtrl *pTab = GetTabControl();
CRect rc;
GetClientRect(&rc);
pTab->MoveWindow(rc);
pTab->AdjustRect(FALSE, &rc);
GetActivePage()->MoveWindow(rc);
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
it works well!
thx
includeh10
|
|
|
|
|
Which control is behind the function of offering a selection of options usually when right-clicking on whatever? Like function Open, New, Copy, etc.
I do not mean menus. For example on the VC++ screen, if I right-click on a code line, I receive the list of selections "Cut, Copy, Paste, Insert File into Project, Open Document, List Members,...".
|
|
|
|
|
This can be done using the CMenu class (CMenu is not only for menus under your title bar). Check the TrackPopupMenu function for more details...
|
|
|
|
|