|
try using the standard fixed-width font: Courier New . it's easier on the eyes and easier to program than trying to force a proportionally-spaced font into evenly-spaced locations.
-c
30% of your base are belong to the IRS!
|
|
|
|
|
ive tried putting different font names into the font.CreatePointFont(120,"Impact",NULL); command, and i've tried passing CEdit->GetDC() instead of NULL, but the font always looks the same, and is not fixed width..
notepad uses fixed width inside of what I assume is a CEdit control, and it prints with fixed width.. i must be doing something wrong, or explaining myself wrong..
thanks!
-dz
|
|
|
|
|
Courier New is a fixed width font... unless you're using it wrong, there's no way for it not to be fixed width... post a screenshot and we'll help you from there
- Roman -
|
|
|
|
|
screen shot
and here is the code that i have currently..
BOOL CTextViewer::OnInitDialog()
{
SetWindowText(m_strTitle);
CDialog::OnInitDialog();
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
CFont font;
font.CreatePointFont(120,"Courier New",NULL);
pEdit->SetFont(&font, TRUE);
return TRUE;
}
i guess maybe i should take the time to look into CEditView (i guess thats whats in notepad).. but im still kinda confused on how to popup a window with a view in it..
-dz
|
|
|
|
|
I'm trying to debug the commandline in an MFC application. I want to load a file with a file assocation to my program. This program will then load the file to open. Just like double clicking a .txt file and opening up in notepad. Any ideas,
Thanks
|
|
|
|
|
I'm not sure what you mean, but you've got commandline support for free in a SDI or MDI MFC project (check the corresponding InitInstance .) Maybe you can start from there.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Are you trying to pass command line arguments to the program.
Project->Settings Debug Tab specify the name of the file you want to load in the "command line arguments" field. This way you can debug the stuff.
|
|
|
|
|
I want to load a file with a file assocation to my program.
Try ftype /? in NT5+. For NT4 and Win32c (aka Win9x) I think you need to edit the registry.
|
|
|
|
|
I was trying to use the ADO transaction mechnasim but had some problems. It appears that when I call the BeginTrans method, for whatever reason I can't terminate this transaction which ends up affecting calls after the tran.
This is my code essentially:
m_pConnection->BeginTrans(&nLevel);
bRet = DeleteObject(....)
if(bRet)
{
}
else
{
m_pConnection->RollbackTrans();
}
Essentially, if I get an error and try to rollback, it appears that the lock remains and I can't do anything else. Any ideas?
|
|
|
|
|
within the if(bRet) , do you commit?
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Hello,
I am attempting to read data from a file which is in numerous types. The data contains chracters, and data of type integer. float and double. I need to read this data off so that it remains in these correct data typse, that is the floats need to be read in as a float and the doubles must be read in as doubles. The data is in big-endian format and once it is read in I will be doing a byte reordering to convert the data to little-endian, which is why it needs to be read in as its saved data type. Thanks for the help.
Josh
|
|
|
|
|
Unless you've got additional info, you're in big trouble. Please note that any sequence of bytes can be interpreted as chats or floating point value. The format of the file somehow must allow you to interpret what kind of data comes next. As for the little-endian big-endian issue, in this post of mine I provide a small routine to do the conversion.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
How can we see the memory used by the DLL which is again used by the exe?
|
|
|
|
|
Is there a way to create an Access database programmatically without having access installed?
Please help!!
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
ADOX.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
I have a thread which launcher another application using ShellExecuteEx(). The problem is, the calling thread is NOT wating till the new Process gets launched.
Is there any way to delay the calling thread until ShellExecuteEx() finishes its job? Or is there any other solution for this???
Thanx in advance.
|
|
|
|
|
Srini Kella wrote:
Is there any way to delay the calling thread until ShellExecuteEx() finishes its job?
WaitForSingleObject()<br />
WaitForSingleObjectEx()<br />
WaitForMultipleObjects()<br />
WaitForMultipleObjectsEx()
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"It was a blind man who taught me how to see." - Aerosmith
|
|
|
|
|
The Wait* functions are not going to work because, once the ShellExecute returns, the corresponding new process will already be in non-signalled state.
I got a work around:
My new process has a got window. So, I delayed the calling thread using EnumWindows() in a loop. EnumWindows() checks for the new window!!
Anybody has got a better solution for this, Please!!
|
|
|
|
|
It will work depending on what you want to do. If you are waiting for the process to finish, then use...
WaitForSingleObject(hProcess, INFINITE); // INFINITE = -1
When the process terminates, it'll return. -1 means it'll wait indefinitely. I thought that's what you wanted, but if you only care about having the window created in the new process then see if this works...
WaitForInputIdle(hProcess, INFINITE); // INFINITE = -1
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"It was a blind man who taught me how to see." - Aerosmith
|
|
|
|
|
I am not waiting for the process to finsih. I am waiting for the process to begin 'fully' instead! Thanks anyway.
|
|
|
|
|
I have a function that returns _variant_t value .
I need to trap this value in a CString object
Please help
|
|
|
|
|
include the atlconv.h header file in your stdafx.h. This will give you access to the STL string conversion macros. then at the top of your function where you are going to convert the variant_t add this:
USES_CONVERSION;
It is a macro that gives you access to the conversion macros for that function. THen to do the conversion do this:
variant_t vResult;
...
CString str;
str = OLE2T(_bstr_t(vResult));
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
kilowatt wrote:
atlconv.h header
kilowatt wrote:
STL string conversion
The ATL headers have NOTHING to do with STL. variant_t is a Microsoft wrapper around a Microsoft type. OLE2T is also not needed. A _bstr_t contains a wide and a narrow char string, and converts between them implicitly.
CString str(_bstr_t(vResult));
should work, if not it just needs a cast to const char * like this:
CString str ((const char *)_bstr_t(vResult));
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
Hello,
I want to do an exe (or the code) that when you execute it, it does like you pressed the "Enter" key.
Thanks
|
|
|
|
|
this seems kinda strange to me.. if you have to double click on the .exe to make it run, and all you want it to do is press enter does that seem harder than just pressing enter?
in any event, even if you do send a message that enter was pressed it would have to be done in a specific window, so you would have to figure out which window to send the enter keypress to (i think)..
maybe some more details or a better explanation?
-dz
|
|
|
|