|
It works, thanks a million. I knew it was something small (i.e. boneheaded) that I was doing wrong. I guess blinding following some articles on the MSDN can lead you into trouble (since they never give you the big-picture view).
|
|
|
|
|
Hi everybody,I used vc 2008 sp1 and created a dialog app.I used
CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_LunaBlue);
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOffice2007));
in CAppEx::InitInstance(),but there were nothing happaned.I wonder thether the dialog app couldn't use CMFCVisualManagerOffice2007 .
Thanx.
|
|
|
|
|
stephen_young wrote: in CAppEx::InitInstance(),but there were nothing happaned.I
I do not think that these styles can be used with dialog apps. To verify, create an SDI app.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Thanx David.Yes the SDI app is OK!!
|
|
|
|
|
Hi!
Is it possible to MultiLanguage Support Facility(e.g English,Chinese and Korean) with VC++? Can any body point me the direction
|
|
|
|
|
Your VC++ program can support multiple languages if you use Unicode versions of API calls. You can build your project with Unicode settings.
You can check out the book "Advanced Windows" by Jeffrey Richter.
|
|
|
|
|
See the eMule source code.
It supports these threee language.
|
|
|
|
|
Yes It is possible.
1) You have to install supplement language support for other languages. You can check it with Control Panel -> Regional and Language option.
2) Set your project as Unicode not ANSI.
I believe in LOVE AT FIRST SIGHT...
Bcoz I have loved my Mother...
even since I opened my eyes...(ICAN)
|
|
|
|
|
In addition to above answer you can also go there[^] to read thread about same toppic.
|
|
|
|
|
Hi!
I've to implement Remember me facility. i.e My application has a log in Form. In this
log in Form, there are two text boxes(one for entering user name and another one for entering
Pass Word), a check Box(called "Remember Me") and a Button called Log in. If the check box is
checked,When we run the exe at the next time, these two text boxes should be filled by the already entered user name and Password. How to do this in C++?
|
|
|
|
|
You should make persistent your application settings (for instance writing them inside the registry). make sure to crypt the password, then.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: for instance writing them inside the registry
Can u elaborate on this?
|
|
|
|
|
You may have a look at one of the many articles about the registry here at CodeProject, see, for instance, Newcomer's A Registry Class[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I have a specific problem:
I need to draw a text like "HomeSweet Home" but it should wordwrap and after wrapping It should be displayed as
"HomeSweet
Home"
how can I do that?
|
|
|
|
|
You may use the DT_WORDBREAK format flag (or manually insert a carriage return-linefeed sequence), see DrawText at MSDN[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi I am trying to create a TCP/IP port programatically in win32.
Here is my code.
HANDLE hXcv;
PRINTER_DEFAULTS pd = {NULL, NULL, SERVER_ACCESS_ADMINISTER};
TCHAR szBuf[MAX_PATH] ={0};
TCHAR szMsg[512];
DWORD dwLastError;
::lstrcpy(szBuf, TEXT(",XcvMonitor Standard TCP/IP Port"));
if(OpenPrinter(szBuf, &hXcv, &pd) != FALSE )
{
OutputDebugString(TEXT("Hello. It worked....!"));
}
else
{
dwLastError = GetLastError();
wsprintf(szMsg, TEXT("OpenPrinter return error:%d\n"), dwLastError);
OutputDebugString(szMsg);
}
> But the problem is OpenPrinter API failing and returning
error code as 5 (ERROR_ACCESS_DENIED).
> But when I try to create the port manually (print properties), port is created.
> I have logged in as an administrator and I have all permissions.
I am working on Windows Server 2008 R2 Statndard (64 bit OS)
Note: OpenPrinter API working fine if I turn-OFF User Account Settings (UAC). Failing if UAC is ON
Please tell me what's wrong with my code.
Thank you in advance.
Regards
msr
modified on Monday, February 14, 2011 6:29 AM
|
|
|
|
|
There is nothing wrong in your code and also do not turn off UAC. Try to execute you application in admin privileges.
select RequireAdminstration as a property.
For future reference:
Google this keyword "Windows7GATrainingKitForDevelopers.Setup.exe" and run this exe. Its a training kit for developer working on Windows 7. It is awesome.
I believe in LOVE AT FIRST SIGHT...
Bcoz I have loved my Mother...
even since I opened my eyes...(ICAN)
|
|
|
|
|
Hi,
"select RequireAdminstration as a property"
I have not understood the above statement.
Cab you just explain me how to do this?
Regards
msr
|
|
|
|
|
1) Open Project property page
Project->Property or use shortcut key (Alt + f7).
2) Select Linker->Manifest File, There is one property UAC Execution level. select this option as requireAdminstration.
When you do this than your application is self elevated and run under admin privilege.
I believe in LOVE AT FIRST SIGHT...
Bcoz I have loved my Mother...
even since I opened my eyes...(ICAN)
|
|
|
|
|
Hi, thanks for the reply.
But in vs2008 there is no such option (Linker -> Manifest fie)for vc++ win32 projects.
Regards
msr
|
|
|
|
|
No I am able to view this property on VS2008 with win32.
What are you doing ?? Please explain....
I believe in LOVE AT FIRST SIGHT...
Bcoz I have loved my Mother...
even since I opened my eyes...(ICAN)
|
|
|
|
|
But I am building a static library.
I think Linker option is not applicable.
Regards
msr
modified on Wednesday, February 16, 2011 11:15 PM
|
|
|
|
|
Hi All
I am using gluBuild2DMipmaps() for show live video buffer.
but it is using the CPU around 50%.
Please suggest how to reduce CPU usages.
Here I am sending you the source code for render.
for (int loop=0; loop<2; loop++)
{
if (loop==0)
{
m_bRenderFromVideo=FALSE;
if(m_pbVideoData)
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, m_iVideoHeight,m_iVideoWidth ,GL_LUMINANCE, GL_UNSIGNED_BYTE, m_pbVideoData);
glViewport(m_iNoOfColumn - m_iNoOfColumn * m_iSizeVideo.x, m_iNoOfRow - m_iNoOfRow * m_iSizeVideo.y,
m_iNoOfColumn * m_iSizeVideo.x, m_iNoOfRow * m_iSizeVideo.y);
glPushMatrix();
gluOrtho2D(-window_width/4, window_width/4, -window_height/4, window_height/4);
glLoadIdentity ();
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_LIGHTING);
glBegin(GL_QUADS);
glTexCoord2f(1.0f, 1.0f); glVertex3f( 21.0f, 18.3f, -10.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-21.0f, 18.3f, -10.0f);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-21.0f, -18.3f, -10.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f( 21.0f, -18.3f, -10.0f);
glEnd();
glScalef(m_fScale, m_fScale, m_fScale);
glRotated(m_fRAngle[0],0.0, 0.0,1.0);
}
else
{
glPushMatrix();
glViewport(0, 0, window_width, window_height);
glLoadIdentity();
glScalef(m_fScale, m_fScale, m_fScale);
glRotated(m_fRAngle[0],1.0, 0.0, 0.0);
glRotated(m_fRAngle[1],0.0,1.0, 0.0);
glRotated(m_fRAngle[2],0.0,0.0,1.0);
}
}
|
|
|
|
|
You have two choiches:
1) Buy a computer with a faster CPU
2) Check if the OpenGL settings on your computer are fine with your hardware (that may be OpenGL capable itself, but may be the library doesn't know it)
Seriously: there is nothing strange in your program. Simply, OGL is a bad beast!
The only thing to check is the driver of your graphic card (are they the correct ones? sometime the OS setups guess wrong settings) and relative settings (if they are), as well as the OGL settings in the control panel (if there are).
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
GAJERA wrote: but it is using the CPU around 50%.
How does your main loop looks like ? I am guessing that you have a continuous loop without any sleep and that your program runs on a double core. In that case what happens is that your loop will be executed continuously and you will probably get a very high framerate. If you can live with a lower (and fixed) framerate, you can simply execute your drawing code every x msec (choose an appropriate time interval between two frames). The rest of the time, your program should sleep (well in fact wait for user events). You can find more info in one of my articles here[^]
|
|
|
|