|
Hi, i don't know FlexGrid but here's a general tip: when you specify a font for your cells or maybe for the entire grid, use a greek charset. In the LOGFONT struct there is a member called lfCharSet, if you set this to GREEK_CHARSET, the font mapper will try to give you a font that has greek characters in it. As said, i don't know the Flex Grid so i don't know how you can make it use a certain font but i guess you will know that. I hope this helps somewhat.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
How to Read a User/System Environment Variable Using c++.
getenv is not working.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
for Visual C++ try this otherwise getenv will work
using namespace System;
using namespace System::Collections;
int main()
{
Console::WriteLine();
Console::WriteLine( "GetEnvironmentVariables: " );
IDictionary^ environmentVariables = Environment::GetEnvironmentVariables();
IEnumerator^ myEnum = environmentVariables->GetEnumerator();
while ( myEnum->MoveNext() )
{
DictionaryEntry^ de = safe_cast<dictionaryentry^>(myEnum->Current);
Console::WriteLine( " {0} = {1}", de->Key, de->Value );
}
}
|
|
|
|
|
That's not C++, it looks like Managed C++ (which isn't really C++ but a different language based on it). This is the wrong forum for code like that.
Steve
|
|
|
|
|
One minute of googling turned up this code:
#include <stdio.h>
#include <stdlib.h>
extern char**_environ;
int main(int argc, char *argv[], char *envp[])
{
char **next = _environ;
while (*next)
{
printf("%s\n", *next);
next++;
}
return 0;
}</stdlib.h></stdio.h>
If you want to get the value of a specific variable you can use GetEnvironmentVariable()
|
|
|
|
|
I had created variable in user section , using the following code
'defining variables
dim objShell, colUserEnvVars
'initializing all variables
Set objShell = WScript.CreateObject("WScript.Shell")
Set colUserEnvVars = objShell.Environment("System")
'Output File for registry information.
colUserEnvVars("rahul") = "rahul"
but i cannot read the same from c++, for this i have to restart the system,
but Wscript.Echo colUserEnvVars("DeloitteAuditShare123") read the value without restarting ths system.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
GetEnvironmentVariable( ) will work from VS2005 onwards. Have you tried that.
|
|
|
|
|
VKupunaram wrote: from VS2005 onward
This API has been around since Windows NT 3.1 which was released in 1993. What makes you think that it is supported only from VS2005 onwards?
|
|
|
|
|
I am using an object of CMapStringtoString. How should I clean up the map contents in the destructor.
|
|
|
|
|
|
Can Any one please help me to get the screen shot of the windows opened in the desktop on CE Device machine. How would the screen shot be saved as bitmap file in the device machine.
A code snippet would be help ful.
Thanks in Advance
|
|
|
|
|
You need to have prnt_scrn.exe for capturing screen shot on a WinCE device.
Syntax of the Print Screen Tool
Prt_scrn [–d NUM] [-s Num1Num2] [–e Num1Num2] filename
Parameters of the Print Screen Tool
-d NUM
Specifies a number of seconds NUM to wait after running the Prt_scrn.exe application before taking the screen shot. The default value for NUM is zero.
-s Num1 Num2
Specifies the location of the upper left vertex of the rectangular region on the screen where to take the screen shot. The values Num1 and Num2 specify, in pixels, the horizontal and vertical coordinates, respectively, of this vertex. The default values for Num1 and Num2 are zero. The default values specify that the upper left vertex is the upper left corner of the screen.
-e Num1 Num2
Specifies the location of the lower right vertex of the rectangular region on the screen where to take the screen shot. The values Num1 and Num2 specify, in pixels, the horizontal and vertical coordinates, respectively, of this vertex. The values for Num1 and Num2 must be greater than the values specified in the -s parameter. The default value for Num1 is the width of the screen in pixels minus one pixel and the default value for Num2 is the height of the screen in pixels minus one pixel. The default values specify that the lower right vertex is the lower right corner of the screen.
filename
Specifies the path and file name of the .bmp file where to save the screen shot. To save the .bmp file to the release directory, add a \release\ prefix to the file name. The filename parameter is a required parameter.
Examples
The following code example shows syntax that instructs the Print Screen tool to take a screen shot on the target device three seconds after running Prt_scrn.exe. This example sends the screen shot to the Snapshot.bmp file in the release directory.
Prt_scrn –d 3 \Release\Snapshot.bmp
The following code example shows syntax that instructs the Print Screen tool to take a screen shot of the (100, 100, 400, 400) screen region on the target device. This example sends the screen shot to the Snapshot.bmp file in the Windows directory on the target device.
Prt_scrn –s 100 100 –e 400 400 \Windows\Snapshot.bmp
|
|
|
|
|
|
Hi..
I am new to this code project..
I have doubt on Visual c++..
My task is to scan the image and find the text in visual c++..
Once if i scan the alphabet it should called the library data base....
1.Create data base
2. How to include the images in the data base
3.Should we include the images in library files..
4.How to call the library files..
Could some one help me out ....
Thanks
|
|
|
|
|
You better seperate the images out of the database as separate image files in the desired format. In the database I would only list the relative path (!!!) to the image of an image directory or server.
Consider changing the image storage for the future!!!
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I want to retrieve handles for all the windows opened in wince machine. Using my application i need to retrieve the handle for the windows that has been opened in desktop and list the title of those windows in a list view .
Thanks in Advance.
|
|
|
|
|
|
I have tried with the folowing code snippet.Still i am not able to retrieve the handle for the window.
WNDENUMPROC lpEnumFunc = &EnumWindowsProc;
TCHAR szName[50];
HWND hTempWnd = NULL;
lpEnumFunc(hTempWnd,lParam);
if(EnumWindows(lpEnumFunc ,LPARAM(hWnd)))
MessageBox(hWnd,L"EnumWindows Successful",NULL,0);
lpEnumFunc(hTempWnd,lParam);
GetWindowText(hTempWnd,szName,50);
MessageBox(hTempWnd,szName,szName,0);
|
|
|
|
|
Well, well try, If that API was supposed to work as per your understanding there are possible risks being caught in an infinite loop or referencing a destroyed window handle.
Call Back functions of an Windows API are not that supposed to be called by you.
struct MYLISTVIEW
{
};
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
#define MAX_TEXT_LEN 256
MYLISTVIEW *plvData = (MYLISTVIEW *)lParam;
if (plvData)
{
TCHAR szWndText[MAX_TEXT_LEN] = _T("");
LONG lStyle = GetWindowLong(hwnd, GWL_STYLE);
LONG lExStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
if (IsWindowVisible(hwnd) && !GetParent(hwnd) && hwnd != GetDesktopWindow() && (
!(lExStyle & WS_EX_NOACTIVATE || lExStyle & WS_EX_TOOLWINDOW)))
{
RECT rc = {0};
GetWindowRect(hwnd, &rc);
if (rc.bottom - rc.top && rc.right - rc.left)
{
GetWindowText(hwnd, szWndText, MAX_TEXT_LEN);
AddWndTextToListView(plvData, szWndText);
}
}
}
return TRUE;
}
MYLISTVIEW g_lvData;
void AddOpenedWindowsToListView()
{
EnumWindows(EnumWindowsProc, (LPARAM)&g_lvData);
}
|
|
|
|
|
I am new to visual studio 2008 and I am stuck. Below is a brief summary of the code and the error that accompanies it. I have tried a bunch of fixes to no avail. Perhaps I do not understand the error could someone please help me? Any suggestions would be appreciated.
CString s;
for(int i=0; i< ROIData.GetCount() ; i++)
{
ROIData.GetText(i,s);
sscanf((LPTSTR)((LPCTSTR) s),_T("%s %d %d %d %d %d d"),&tmp,&temp.lbk.l,&temp.lbk.u,&temp.pk.l,&temp.pk.u,&temp.ubk.l,&temp.ubk.u);
temp.label.Format(_T("%s"),tmp);
m_arROI.Add(temp);
}
The error that accompanies the is "error C2664: 'sscanf : cannot convert parameter 1 from 'LPTSTR' to 'const char *'"
I would be happy to provide any other information I can if any more is needed.
Thanks in advance!!!
|
|
|
|
|
|
xzing wrote: sscanf((LPTSTR)((LPCTSTR) s),_T("%s %d %d %d %d %d d"),&tmp,&temp.lbk.l,&temp.lbk.u,&temp.pk.l,&temp.pk.u,&temp.ubk.l,&temp.ubk.u);
As side note to Stuart's reply, you don't need neither (LPCTSTR) , nor (LPTSTR) .If you cannot spot why, then you should read again, carefully, the article suggested by Stuart.
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,
is there a difference in how menu items are processed in Doc-View apps vs. Dialog-based apps?
I am trying to work with the ON_UPDATE_COMMAND_UI callback in a Dialog-based app for a menu item in the Dialog's main menu.
(I posted my problem here [(Enable/Disable menu items^)]">)
It seems that within my ON_UPDATE_COMMAND_UI function, it doesn't execute the statement pCmdUI->Enable( FALSE ) - thus NOT setting the menu item as I want
Thanks!
|
|
|
|
|
john john mackey wrote: is there a difference in how menu items are processed in Doc-View apps vs. Dialog-based apps?
Yes.
See this article[^]
|
|
|
|
|
You are the frickin MAN!
thanks for the info!
|
|
|
|