|
I printed the full path using pFile.GetFilePath(), it's giving me the full path (correct) of the file.
|
|
|
|
|
Um, Sorry I can not see anything wrong with what you are attempting to do. GetLength should return the size in bytes of the opened file in question.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
It is hard for us to help you, if you do not tell us whether there is an error when you use CFile::Read(...).
DWORD dwStart = pFile->GetPosition();
DWORD dwBitsSize = pFile->GetLength();
printf("\n Size %d\n", dwBitsSize);
BITMAPFILEHEADER fileHeader;
memset(&fileHeader, 0, sizeof(fileHeader));
TRY
{
UINT count = pFile->Read(&fileHeader, sizeof(fileHeader));
printf("\nByte Read %d %d\n", count, pFile->GetPosition());
}
CATCH(CFileException, e)
{
printf("\nCFileException %d\n", e->m_cause);
}
END_CATCH
|
|
|
|
|
In the calls to printf() , what happens if you change %d to %lu ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi there,
can anyone tell me how to stop a link opening in a new window and just use the existing window??
For example: I've got a little explorer app(MFC) with 2 windows. The left side displays the C:/drive
and the right side displays a FTP address. The left window navigates fine, but the right side insists on opening
a new explorer window when I click on a link, instead of changing inside its own window. When the ne window opens... that navigates fine... just the way I want the right side widow to.
Its probably something stupid, knowing me... definately something stupid But I've tried a bunch of stuff for the last
24 hours now and nothing stops it opening in a new window!
Help!
Henry F
|
|
|
|
|
If I understand you correctly, the right pane is actually an HtmlView displaying a web page. In any case, to redirect a link to a specific window you have to use the "target" property. For example:
// somewhere in an HTML file
<a href="http://www.website.com" target="_self">Click here</a>
"target" accepts any of the following:
_blank, which opens the link in a new window
_self, which opens the link in the current window
_parent, which opens the link in the parent window
_top, which opens the link in the top most window
Hope this helps.
|
|
|
|
|
Thanks for the reply man, but(as usual) its not the HTML I need to change.
Basically its an Explorer Window displaying content on a server via FTP:
Naviagte2(_T(ftp://whatever.com),NULL,NULL)
It displays fine but when I want to open a folder - it launches a new explorer window outside the application and displays the info in that window.
Is there some way of controlling this so that all clicked links open inside the application only?
thanks
|
|
|
|
|
handle OnBeforeNavigate2, cancel the navigation if it's to another window, and navigate to the url just cancelled... something like that.
|
|
|
|
|
Clever idea!
Any chance you could scribble the code down? I'll buy u a cup of tea
|
|
|
|
|
I have an important CStatic text-lable in my CDialog class.
How may I change the font and color of the text in a simple way?
_____________________________
...and justice for all
APe
|
|
|
|
|
You need to subclass your static control. Then overwrite the OnPaint() member with the following example:
void CMyStaticCtrl::OnPaint() <br />
{<br />
CPaintDC dc(this);
<br />
CFont newFont;<br />
LOGFONT lf;<br />
<br />
memset(&lf, 0, sizeof(LOGFONT));<br />
lf.lfHeight = 20;<br />
lf.lfWeight=FW_BOLD;<br />
strcpy(lf.lfFaceName, "ARIAL");<br />
newFont.CreateFontIndirect(&lf);<br />
<br />
dc.SetBkMode(TRANSPARENT);<br />
dc.SetTextColor(RGB(255, 0, 0)); <br />
dc.SelectObject(&newFont); <br />
dc.TextOut(0, 0, "Text in Arial, bold, red");<br />
}
Hope this helps
MS
|
|
|
|
|
Thanks!
A little irritating that you need to subclass to just change the color.
Again - Thanks!!
_____________________________
...and justice for all
APe
|
|
|
|
|
That's right, but the "normal" way didn't work for me. It changed the font, but not the color and the background appeared white even though i set it to transparent.
MS
|
|
|
|
|
I Want to create a popup window at my dialog based program,could you tell me how?
Could I register a new window class for it?
If no necessary,how can I get the lpClassName which is used at the follow function ?
HWND CreateWindowEx(
DWORD dwExStyle,
LPCTSTR lpClassName,
LPCTSTR lpWindowName,
DWORD dwStyle,
int x,
int y,
int nWidth,
int nHeight,
HWND hWndParent,
HMENU hMenu,
HINSTANCE hInstance,
LPVOID lpParam
);
Thanks!
free like a bird
|
|
|
|
|
CString sClassName = AfxRegisterWndClass (CS_HREDRAW|CS_VREDRAW);
now use sClassName
There is no spoon.
mail
|
|
|
|
|
lpClassName is either an existing class name
e.g.
Button, Edit, SysTreeView32, ...
or a class that you registered via RegisterClassEx().
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hello everybody,
I want to paint something outside my app.
like a multimedia keyboard:
when I increase or decrease the volume something
appears on screen.
best wishes.
thanks
|
|
|
|
|
Use GetDesktopWindow() API to get Handle to Desktop Window, Then create a DC with this handle and enjoy
Imagine that you are creating a fabric of human destiny with the object of making men happy in the end, giving them peace and rest at last, but that it was essential and inevitable to torture to death only one tiny creature..and to found that edifice on its unavenged tears, would you consent to be the architect on those conditions? Tell me, and tell me the truth!
-Fyodor Dostoevsky, The Brothers Karamazov
|
|
|
|
|
Dear friends,
I try to develop a program which can hook into IE (toolbar buttons and/or menu items in IE window) to get all text in all text fields in a HTML page being displayed by IE. This will perform when user click on the toolbar button or menu item.
I don't know how to start and from where to begin. Could you please help me on this and thanks in advanced.
|
|
|
|
|
You will have to write a BHO(Browser Helper Object).
You can start from here[^]msdn
Also look for BHO samples here in codeproject also.
There is no spoon.
mail
|
|
|
|
|
Thank you suhredayan very much for your kind help. I'm searching in codeproject for the sample code.
I will go back to this topic if there are some confusion to me and need your help again.
Once again, thank you.
|
|
|
|
|
you are welcome TPN.
There is no spoon.
mail
|
|
|
|
|
Hi!
I’m creating an ActiveX control in my myapp.aspx-page using the <object> - tag.
<br />
<OBJECT id="objComp" style="Z-INDEX: 101; LEFT: 24px; WIDTH: 974px; POSITION: absolute; TOP: 40px; HEIGHT: 538px"<br />
</OBJECT><br />
At this time I’m only using the ActiveX technology to publish my MFC application on the net. I’m about to make a call to may webpage like this:
http://www.mypage.com/myapp.aspx?user=bill&password=12345
How may I pass the “user” and the “password” into my ActiveX?
Can I how do I access the properties of my ActiveX from my page?
The ActiveX is supposed to run on the client – not on the server.
_____________________________
...and justice for all
APe
|
|
|
|
|
hi
ya its for sure that ActiveX runs on client side
you can access methods as well as properties exposed by your control from your page
e.g. if your control exposes a method like SetUseridPassword(BSTR usrID,BSR password) then you can access it as follows
<OBJECT
ID="MyActiveXID"
CLASSID="clsid:your-control-class-id-here"
CODEBASE="TestAX.ocx"
TYPE="application/x-oleobject"
>
then on any event (like button's onClick) call the following following function like onClick='InitValues'
don't forget to define this script in head section of your page.
<script language="JavaScript">
function InitValues()
{
MyActiveXID.SetUseridPassword("testusr","tstpassword")
}
</script>
Muhammad Azam
|
|
|
|
|
It really looks like you have the solution of my problem. I try to implement it with javascript.
THANKS!
_____________________________
...and justice for all
APe
|
|
|
|