|
How to show the 'Privacy Report' dialog in CHtmlView Based Application?
Thank you.
tomorrow
|
|
|
|
|
hi,
i can not use these code:
Bitmap* curBitmap = new Bitmap(L"sunset.bmp");
error for this code is:
f:\visual sutido project\ImageProcessing\ImageProcessing\ImageProcessing\ImageProcessingView.cpp(73): error C2660: 'Gdiplus::GdiplusBase::operator new' : function does not take 3 arguments
is any opinion??!!!;)
|
|
|
|
|
|
Hi,
I am having this strange issue that I cant trace because my program works just fine when debugging from within VS or any other debugger (I tried olly as well), but whenever I run it from the explorer it doesnt work completly.
I am reading values from the registry using this Wrapper.
Then Im assigning the value of the key to a variable like this:
char * binaryData = (char *)value.operator LPCTSTR();
Then I'm converting the char from UTF8 to Unicode, but there should not be a problem.
However, the resulting string has in the most cases something appended like "=C:\Pr " which looks like a string to me but I have no idea how it got appended to the registry value.
The strange thing now is that whenever I debug it with VS it works, but when I run it normally from windows it puts those strange characters at the end of the strings.
Btw, my strings are in REG_BINARY format.
Does anyone know what the problem here is?
Thanks,
lucki_luke
|
|
|
|
|
try running from VS without debugger (ctrl-f5?) i think problem must be with env and/or project settings. we faced one similar problem where the error occurred only in release mode. we had to change some 3rd party libraries as far as i remember.
----------------------
Mayank Thakore
Learning C++ - since 1998
They didn't print my card right; so I resigned.
|
|
|
|
|
When running from VS without debugger it doesnt work either, and as I said before it works even when running from OllyDbg.
And Debug or Release mode doesnt matter as it works in both modes with debugger and not without...
I have totally no idea what to do...
|
|
|
|
|
Check for variables that are not initialized.
Debugger mode (or debug build) will initialize variables with some non-zero data, while release mode might contain random data or zeros.
That is usually the difference.
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Hi,
I'm having difficulties using CString's LoadString under VC++ 8.0. I'm not sure what to make of it. I'm attempting to load a string from resources and getting back an incomplete string, e.g. "This application is registered to %1 %2For use on the computer named %3 only." and getting back, "This application is registered to %1????". The '?' are inserted into the string. I'm a total newbee to VC++ 8.0.
It seems to be random, cause loading strings from the resource seems to work correctly in the instances above the lines of code before calling the last LoadString.
e.g.
BOOL CAboutDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CString cs0, cs1, cs2, cs3, cs4;
DWORD dwSizeUserName, dwSizeComputerName, dwError;
char szUserName[MAX_COMPUTERNAME_LENGTH + 1];
char szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
dwSizeUserName = MAX_COMPUTERNAME_LENGTH + 1;
dwSizeComputerName = MAX_COMPUTERNAME_LENGTH + 1;
szUserName[0]=0;
szComputerName[0]=0;
m_nAppIcon.SetIcon(::LoadIcon(theApp.m_hInstance, MAKEINTRESOURCE(IDR_MAINFRAME)) );
cs0.Empty();
cs0.LoadString(AFX_IDS_APP_TITLE);
AfxSetWindowText(::GetDlgItem(this->m_hWnd, IDC_STATICTEXTAPPNAME), cs0);
cs0.Empty();
cs1.Empty();
cs2.Empty();
cs3.Empty();
cs4.Empty();
cs1.LoadString(IDS_STRABOUTAPPINFO);
// IDS_STRABOUTAPPINFO =
// File Version: %s\nProduct Version: %s\nApplication Info: %s\n\n%s by
// %s. All Rights Reserved.
cs2.LoadString(IDS_FILEINFOCOMMENTS);
// IDS_FILEINFOCOMMENTS = Comments
cs3.LoadString(IDS_FILEINFOLEGALCOPYRIGHT);
// IDS_FILEINFOLEGALCOPYRIGHT = LegalCopyRight
cs4.LoadString(IDS_FILEINFOCOMPANYNAME);
// IDS_FILEINFOCOMPANYNAME = CompanyName
cs0.Format( cs1,
CAppUtilitylFunctions::GetFileVersionX(),
CAppUtilitylFunctions::GetProductVersionX(),
CAppUtilitylFunctions::GetVersionInfo(NULL, cs2),
CAppUtilitylFunctions::GetVersionInfo(NULL, cs3),
CAppUtilitylFunctions::GetVersionInfo(NULL, cs4));
AfxSetWindowText(::GetDlgItem(this->m_hWnd, IDC_STATICTEXT1), cs0);
if( !(::GetUserName(szUserName, &dwSizeUserName)) )
{
dwError = GetLastError ();
}
if( !(::GetComputerName(szComputerName, &dwSizeComputerName)) )
{
dwError = GetLastError ();
}
else
{
cs0.Empty();
cs1.Empty();
// THIS LOAD FAILS TO LOAD ALL OF THE STRING IN THE RESOURCE
cs1.LoadString(IDS_ABOUTAPPINFO);
// IDS_ABOUTAPPINFO =
// This application is registered to %1 %2For use on the computer
// named %3 only.
cs0.FormatMessage( cs1,
szUserName,
"\n",
szComputerName);
AfxSetWindowText(::GetDlgItem(this->m_hWnd, IDC_STATICTEXT2), cs0);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
Can someone shed some light on this for me? I'm thinking that it must have something to do with project settings....
Thanks!
Jon68z
|
|
|
|
|
Jon68z wrote: // THIS LOAD FAILS TO LOAD ALL OF THE STRING IN THE RESOURCE
cs1.LoadString(IDS_ABOUTAPPINFO);
// IDS_ABOUTAPPINFO =
// This application is registered to %1 %2For use on the computer
// named %3 only.
Can you check its return value ? Its BOOL .
To narrow down the problem , can you check value in cs1, by showing it in message box?
|
|
|
|
|
Hi,
Thanks for the reply. using bool bRet, e.g. bRet = cs1.LoadString(IDS_ABOUTAPPINFO); The return value is 'true'. The string returned however is truncated and contains, cs1 "This application is registered to %?????" ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > > as reported in the VC++ 8.0 IDE 'Autos' tab.
If I use a line like 'CString cs5(MAKEINTRESOURCE(IDS_ABOUTAPPINFO));' cs5 is equal to the same malformed string as if I loaded it from the resource string table above.
Do I have to specify something in my project settings ?
Or is something getting screwed up in the string table....
Thanks!
Jon68z
|
|
|
|
|
Problem seems to be with format specifiers you have mentioned. Can you see same problem with strings without format specifiers(%).
|
|
|
|
|
Hi,
Thanks for your reply. Actually, if I move the string loading to the top of the function, it works correctly. The entire string is loaded. I've tried several locations to narrow down where the load string gets truncated, but have not found the problem.
This is driving me mad, as I know something else is wrong, and it is not LoadString() per se, but have not been able to find the problem.
Thanks!
Jon68z
|
|
|
|
|
Hi,
I've changed the previous Format to FormatMessage and the specifiers to %1, %2, %3, etc. and all seems to be fine with the string loading as it should. It is hard for me to believe that using CString Format could screw up memory on an unrelated LoadString.... Hmmm.
Any body have any ideas on this?
Please help....
Thanks!
Jon68z
|
|
|
|
|
There is difference bet'n Format and FormatMessage , the way format specifiers are mentioned.
::FormatMessage documentation in MSDN can through some light on it.
Jon68z wrote: It is hard for me to believe that using CString Format could screw up memory on an unrelated LoadString.... Hmmm.
Actually , instead of using same variable(using Empty ), try using different variables.(this is just wild try).
|
|
|
|
|
Hi,
I have a CPropertySheet embeded in a CPropertyPage.
Can anyone tell me how to move or size the embeded property sheet?
Thanks in advance
Ferdinand
|
|
|
|
|
Hi everyone,
I have again question I read about Certification from microsoft MCAD/MCSD
here[^] but i want to know
for which languages is it for VC++
|
|
|
|
|
You should read the full page, in particular the content of the exams. ASP.NET, VB.NET, C#.NET... Think of .NET as an extension to all of the programing languages.
|
|
|
|
|
Thanks waldermort for help i read full page but i cant find that VC is in these exams or not and i want to know do you have any document for VC like document for C# or ASP.NET
|
|
|
|
|
Hi everyone,
When i want to open my project i get this error
Project 'C:\MyBook\MyBook.vcproj' failed to open.
Thanks
|
|
|
|
|
try deleting all of the extra files that VS adds to the directory. But make sure not to delete the .dsp and .dsw files.
|
|
|
|
|
I dont have .dsp or .dsw i use VS2003 which files i need to delete
|
|
|
|
|
Hi,
I want to get the active childframe in a MDI application when I am in the ViewClass. I need a pointer of CWnd to use it as parameter for MDIActivate.
Can someone tell me how to get it?
Thanks for help
yummi
|
|
|
|
|
Hello
1- CWnd::GetActiveWindow() . Doesn't it work with you?
2- Or even better CWnd::GetTopWindow() .
Regards
|
|
|
|
|
Hi Nader,
thanks for your reply. So I got the window, but I can't use it for what I want to do.
In my MDI application I open new childframes automaticly but I want to stay the actually childframe in front.
I tried this way:
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
CErgebnislisteView *pView = (CErgebnislisteView *) pChild->GetActiveView();
for(i=0; i< arrVerz.GetSize(); i++)
{
theApp.OnOldTurnier();
}
pChild->SetActiveView(pView);
Do you have an idea how do do it?
yummi
|
|
|
|
|
yummi wrote: CErgebnislisteView *pView = (CErgebnislisteView *) pChild->GetActiveView(); //Open new childframes for(i=0; i< arrVerz.GetSize(); i++) { //set some variables and open it with the next line theApp.OnOldTurnier(); } //activate the old childframe pChild->SetActiveView(pView); //nothing happens
pView is already active view. why you are setting it to active again. It must be working.
|
|
|
|