|
Hello.
You can change the file size as long as you have the file opened for writing, so "r+" (append) is OK.
The _fileno() function is in the runtime library, so you do have it, for sure. It's declared in stdio.h.
If it's missing, the try using fileno() instead.
Kakan.
|
|
|
|
|
How to refresh the intellisense information about functions that are on a file OUTSIDE the project, that is linked using #include?
(delete the file xxx.ncb don't work)
Have a nice code day
|
|
|
|
|
_Russell_ wrote: OUTSIDE
put it INSIDE
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#ffaaaa">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Hi.
I'm building an MFC app, and at this time trying to add printing facilities.
What i need to do, is to print the image (all the windows of my app show different images) so that it fits the printing page...i've been trying to find the correct calculation (working on OnPrepareDC) with different page/window/screen measures (GetDeviceCaps(...)), but i don't seem to get it.
The pseudo code of OnPrepareDC:
<br />
SuperView::OnPrepareDC(pDC, pInfo);<br />
if (IsPrinting)<br />
{<br />
pDC->SetMapMode(MM_ANISOTROPIC);<br />
CClientDC dc( this );<br />
CSize szScreen = dc.GetDeviceCaps(...);<br />
pDC->SetWindowExt( szScreen );<br />
<br />
CSize szPage = pDC->GetDeviceCaps(...);<br />
CSize szfinal = SOME_CALCULATIONS(szScreen, szPage);<br />
pDC->SetViewportExt( szFinal );<br />
}<br />
...<br />
If someone understood the message, and knows something about it...will save my life.
Thanks,
Alberto
|
|
|
|
|
What's the siplest way to read from and write to the registry?
Thanks
KevinSheedy
|
|
|
|
|
CWinApp::WriteProfileString(..)
CWinApp::GetProfileString(..)
CWinApp::WriteProfileInt(..)
CWinApp::GetProfileInt(..)
Have a nice code day
|
|
|
|
|
Do a search for RegOpenKey - you will likely find usable examples of how to use the registry-related functions.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Dear All,
Kindly letme know is there any ActiveX or MFC control which is equivalent to DirList Control.
Regards,
Mayank Srivastava
-- modified at 8:03 Wednesday 11th January, 2006
|
|
|
|
|
Ok very popular question
how do i crash my programe before reaching main.
I dont actually want to crash the programe but
want to know how can i execute a piece of code
before main is executed .
Consider C and C++ only
Answer shoud be compiler independent
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
create any gloabl object, in ur program. put some code to crash in its constructor
Kill before even born....Its is called abortion!!!
-- modified at 7:14 Wednesday 11th January, 2006
|
|
|
|
|
What about C ???
this is c++
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
Patch random bytes in the EXE until you find something that works
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Of the top of my head, can't think of a way in C, but in C++ you can simply use some form of static initialiser.
Be warned though, that they can cause problems if not handled correctly. I'd recommend asking yourself if you really need to do this?
Kev
|
|
|
|
|
Pls elaborate "Static initialiser ".
Small code can be of help.
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
1. Get yourself a sledge hammer
2. Take a deep breath
3. Swing the hammer back and give the program (The display, where it is being shown) a merciless blow.
4. The program should have crashed by now.
This is a code sample
<br />
#include<iostream><br />
using namespace std;<br />
<br />
class GoGoGo<br />
{<br />
public:<br />
GoGoGo() <br />
{ <br />
cout << "This runs first!";<br />
} BeFirst;<br />
}<br />
<br />
int main()<br />
{<br />
cout << "Main is second :(";<br />
return 0;<br />
}<br />
Google for interview questions and u will find a lot of stuff. I learned this from google some months back.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
What about C ???
this is c++
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
You need to declare an instance of class GoGoGo before this will work - i.e.:
GoGoGo executesBeforeMain;
Kev
|
|
|
|
|
It has to be
class GoGoGo<br />
{<br />
public:<br />
GoGoGo()<br />
{<br />
cout << "This runs first!";<br />
}<br />
}BeFirst;
never say die
|
|
|
|
|
Sorry abt that. Din notice it.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
int CrashingFunc();<br />
<br />
static int SomeIntThatCrashesTheProg = CrashingFunc();<br />
<br />
int CrashingFunc()<br />
{<br />
}
The static variables will be evaluated first and this will call your CrashingFunc before the main()
|
|
|
|
|
is it neccesary to put static .
static int SomeIntThatCrashesTheProg = CrashingFunc();<br />
<br />
int CrashingFunc()<br />
I feel int SomeIntThatCrashesTheProg has to be Global which u have defined with static
never say die
-- modified at 9:27 Wednesday 11th January, 2006
|
|
|
|
|
yeh globals
if they are initalised then
they can crash the prog .
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
Why do you want to do so? Can you tell the usability?
Vipin - MVP
|
|
|
|
|
Actually i dont want to crash the
program but i am studying the reason
by which the programs can crash before
the main function is exectuted
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
vikas amin wrote: i am studying the reason
by which the programs can crash before
the main function is exectuted
If so, you will do a never ending study. Atleast after you start with windows programming. (If you ever finish studying this with C and C++)
Why do this dude? Destructive mind huh?
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|