|
Hi everyone ~~
can you help me !
Now I'm working in my project. I have a problem With print.i ues map mode is MM_TEXT but printed the character display so small so i use LPtoDP but it was like change before ,so i need help how to change ????
code like this:
void CMyFormView::OnDraw(CDC* pDC)
{
CFormDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
pDC->SetMapMode(MM_TEXT);
RECT rc;
GetClientRect(&rc);
pDC->LPtoDP(&rc);
pDC->TextOut(110, 200, "ad");
}
nothing
|
|
|
|
|
Dear all,
I am building the GUI to install the device driver and software.In the case, it will provide User Installation Guide for enduser to read which is the PDF file format.
Therefore, How to check the system whether the system have installed Acrobate Reader or not?
If have always not installed that the system must be required to intall the reader befor ShellExecuteEx (Open) the PDF file.
Thanks for the help. If there is any suggestion, please feel free to let me knowor help.
Best Regards
Steve Chang.
|
|
|
|
|
One way is to take help of registry. But again this will help while installation as you wull have admin rights then.
|
|
|
|
|
See if there is an application associated with the .PDF extension using FindExecutable() or AssocQueryString() . If there is, compare its name to AcroRd32.exe.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
See if there is an application associated with the .PDF extension using FindExecutable() or AssocQueryString(). If there is, compare its name to AcroRd32.exe.
I'd think you'd want to make the more general check to see if any app is associated with the pdf extension. Since the intent is simply to view the file it shouldn't matter if the user has the acrobatreader installed, is a graphics designer and has the full fledged acrobat application, or is using a 3rd party pdf reader instead.
|
|
|
|
|
Can this class be used without CLR?
Or how can I use WMI without CLR???
I use vc6 with the latest SDK,but there is always a compiler error as bellow:
Deleting intermediate files and output files for project 'Netcfg - Win32 Release'.
--------------------Configuration: Netcfg - Win32 Release--------------------
Compiling...
Netcfg.cpp
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\comutil.h(101) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Error executing cl.exe.
Netcfg.exe - 1 error(s), 0 warning(s)
what's wrong? How to fix it??
Thank you all here.
Thank you very much.
|
|
|
|
|
You've confused the compiler. remove lines of your code until it compiles, then look at the code you removed and see what is wrong.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Everyone!
Can you help me!
Now I'm working in my project. I have a problem With Create a Preview Video with source from Camera. After starting preview 5 minute I want to draw a red rectange on preview.
My idea is Creating two Static. one of them is transparent Static that is always ontop. Then Draw rectange on it.
pls! Can you show me your solution.
Many thanks.
|
|
|
|
|
If you're using DirectX, you can create a Filter to draw over the video. You can't put a control over the video to draw on it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Please help me!
Please show me how to connect to any database (SQL server or Access 2000) by code (not by wizard)
thank you for helping
|
|
|
|
|
Use CDatabase class, and its open() function
MSDN description of same is given as
CDatabase m_dbCust;<br />
<br />
m_dbCust.Open( _T( "MYDATASOURCE" ), FALSE,<br />
FALSE, _T( "ODBC;UID=JOES" ),<br />
<br />
m_dbCust.Open( NULL );
refer this
http://www.codeproject.com/database/readdb.asp[^]
|
|
|
|
|
Just to give you an idea, I recently used the following code in one of my projects:
CDatabase m_db;
<br />
try<br />
{<br />
CString sConnect;<br />
sConnect ="DRIVER={Oracle in Ora81RET}; DBQ= MYDATABASE.LOCAL; UID=scott; PWD=tiger; PFC=500";<br />
m_DB.OpenEx(sConnect, CDatabase::noOdbcDialog);<br />
}<br />
catch(CDBException *x)<br />
{<br />
try<br />
{<br />
CString sConnect;<br />
sConnect ="DRIVER={Oracle in OraHome92}; DBQ= MYDATABASE.LOCAL; UID=scott; PWD=tiger; PFC=500";<br />
m_DB.OpenEx(sConnect, CDatabase::noOdbcDialog);<br />
}<br />
catch(CDBException *x)<br />
{<br />
CString szTemp = "Database Connection not responding due to following reason(s):\n\n";<br />
szTemp += x->m_strError;<br />
AfxMessageBox(szTemp, MB_ICONERROR);<br />
exit(1);<br />
}<br />
}
Then, to query the database, you can code like this:
CRecordset cSet(&m_DB);<br />
CString szSomething;<br />
CString szSQL = "SELECT SOMETHING FROM SOMEWHERE"
cSet.Open(CRecordset::forwardOnly, szSQL, CRecordset::readOnly);<br />
while(!cSet.IsEOF())<br />
{<br />
cSet.GetFieldValue((int)0, szSomething);<br />
cSet.MoveNext();<br />
}<br />
cSet.Close();
Hope that helps
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|
|
It seems FindFirstFileEx is available only with _WIN32_WINNT >= 0x400.
I am on Windows XP SP2 with visual studio 6 and Feb 2003 PSDK.
The compiler still cannot find FindFirstFileEx and I define _WIN32_WINNT in my stdafx as 0x400. so what is _WIN32_WINNT and when is it >= 0x400.
Although I could get things working by defining _WIN32_WINNT as 0x400, I am worried if thats the right value and if any other definitions arent available due to the value being smaller.
Can someone throw some light on _WIN32_WINNT? Thanks.
|
|
|
|
|
Flace wrote:
The compiler still cannot find FindFirstFileEx and I define _WIN32_WINNT in my stdafx as 0x400...Although I could get things working by defining _WIN32_WINNT as 0x400,
These contradict each other. Is it working or not?
Flace wrote:
Can someone throw some light on _WIN32_WINNT?
Set it to the minimum value required.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
These contradict each other. Is it working or not?
I am sorry, I meant it isnt working unless I set it some value. My understanding is that this preprocessor variable is automatically defined for you to the correct number suitable to your current operating system. That is why I am wondering why I have to set it again. It is not clear why I have to set it explicitly and to the minimum value.
Thanks for any clarification.
|
|
|
|
|
Flace wrote:
I meant it isnt working unless I set it some value.
Which is the correct, normal behavior.
Flace wrote:
My understanding is that this preprocessor variable is automatically defined for you to the correct number suitable to your current operating system.
How is the preprocessor going to know the OS of the target machine?
Flace wrote:
It is not clear why I have to set it explicitly and to the minimum value.
So that you can use functions that are going to be available on the target machine. See here for more.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
To let the debugger not generating the error message like:
": identifier was truncated to '255' characters in the debug information"
I add the
#pragma warning(disable: 4786)
int stdafx.h
#if !defined(AFX_STDAFX_H__077D2F6E_ABD0_4A35_9103_5D360AEF8B93__INCLUDED_)
#define AFX_STDAFX_H__077D2F6E_ABD0_4A35_9103_5D360AEF8B93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h>
#include <afxext.h>
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxole.h>
#include <afxodlgs.h>
#include <afxdisp.h>
#endif // _AFX_NO_OLE_SUPPORT
#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h>
#endif // _AFX_NO_DB_SUPPORT
#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h>
#endif // _AFX_NO_DAO_SUPPORT
#include <afxdtctl.h>
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>
#endif // _AFX_NO_AFXCMN_SUPPORT
#pragma warning(disable: 4786)
#include <algorithm>
#include <functional>
#include <memory>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <utility>
#include <deque>
#include "Resource.h"
#endif // !defined(AFX_STDAFX_H__077D2F6E_ABD0_4A35_9103_5D360AEF8B93__INCLUDED_)
But this error message still pops out?
|
|
|
|
|
Put it at the very top and pray. I have similar issues.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I move it to the top as you said!The messages finally dispear!
I wonder the causes, On my wild guess: some MFC headers include STL header in stdafx.h, in my previous code stucture the #pragma was put after those MFC headers, so...
|
|
|
|
|
http://www.codeproject.com/vcpp/stl/stl_without_warnings.asp[^]
Be sure to read the comments below the article, they point out and fix some of the problems not addressed in the article itself.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hello everyone!
OK, I downloaded and installed both of these. I want to make native Windows apps. I ran the register tool in the VC++ Start menu folder, but all I see under "Win32" under "New Project" is console applications... I was trying what the SDK docs told me, it didn't work because I got nothing under "VC++ Directories"... Anybody know what I can do? Thanks!
Sulfurik K. Nosferathus (Darth_Sulfur)
www.SulfurMidis.com
www.SulfurSoft.tk
http://www.BeepXtreme.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
Express does not support MFC, maybe it doesn't support Win32 either ? I'm sure you can create a Win32 app though, because there's no real framework stuff beyond an include, try to download some Win32 samples and see if they will compile.
Also, it's possible the SDK did not add itself to the include and link directories, if so, you need to do that manually as well.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
Express does not support MFC
You're saying that I wasted like 3 GB on it? NOOOOOOOOOOO!!!!!!!!!
But it can't be! Look:
http://www.thefreecountry.com/compilers/cpp.shtml[^]
That site said:
Microsoft Visual C++ 2005 Express Beta is currently available for download free of charge from Microsoft's site. It allows you to create programs for the .NET framework, and possibly also native Win32 programs (with the help of the separately downloaded Microsoft Windows Platform SDK).
There has to be a way to do this... Anybody else know? Thanks!
Sulfurik K. Nosferathus (Darth_Sulfur)
www.SulfurMidis.com
www.SulfurSoft.tk
http://www.BeepXtreme.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
Darth_Sulfur wrote:
But it can't be!
It is, I am afraid.
Darth_Sulfur wrote:
Look:
From that page:
Disclaimer
The information provided on this page comes without any warranty whatsoever. Use it at your own risk. Just because a program, book or service is listed here or has a good review does not mean that I endorse or approve of the program or of any of its contents. All the other standard disclaimers also apply.
MFC, ATL and the Windows headers/libraries are not included with this version. To create Windows programs, you will need to download the Microsoft Windows Server 2003 Platform SDK as well (for the Windows headers and import libraries).
So like I said, you can't do MFC. Looks like you can do Win32, but you need to wire up the right directories yourself, if you installed the PSDK and did not get a good result.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|