|
Check for the .PDF extension registration. Adobe is by far the most popular pdf reader, but it isn't the only one.
Acrobat 6 is such a pain that I'm now hoping someone ports xpdf to windows. In the mean time I open all pdfs on my unix machine. (mind xpdf sucks worse in most ways, but it loads so much faster that I can normally live with the loss of features. One day it might get those features.)
|
|
|
|
|
|
How can I access an HTML resouce "myfile.html" from an
MFC extension DLL?
I've tried two methods:
Downloading the address (res://extension.dll/myfile.html) [because it works in IE if you type it is]
and
Loading the library and attempting to get the resource from there but when I try to get the file name it complains about the name being a CString and not struct HRSC__* [meaning how could i call for myfile.html after parsing it out of the address [which is a CString]]
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
I had to go the route of loading the library and reading the resource file,
After loading it I got the HRSC from the FindResource with the type RT_HTML [this is why I never was able to find anything on google].
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
|
Maybe, after all it was difficult to find on google so maybe, if i can find time.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
Hi
Let's say I have a pointer to a BITMAPINFO structure, and the structure holds information about an RGB bitmap in memory. Is there a way for me to directly write some string on top of the bitmap?
Currently I do it like this:
HDC hDC = CreateCompatibleDC(NULL);
void *pDIB;
HBITMAP hBmp = CreateDIBSection(hDC, pBmpInfo, DIB_RGB_COLORS, &pDIB, NULL, NULL); //pBmpInfo in of type BITMAPINFO*
memcpy(pDIB, pData, iWidth * iHeight * 3); //iWidth and iHeight are the width and height of the image, respectively, and pData is a pointer to the bitmap's pixel values, multiplied by 3 because it's RGB
SelectObject(hDC, hBmp);
DrawText(hDC, "This is a test", strlen(cstrStatus), &CRect(5, 5, iWidth, iHeight), DT_LEFT);
memcpy(pData, pDIB, iWidth*iHeight*3);
DeleteObject(hBmp);
DeleteDC(hDC);
So basically I first copy the bitmap's pixel values to a buffer created using CreateDIBSection, write the text on the DIB, and copy the DIB pixel values back to the original bitmap pixels' location. Is there a more efficient way to do this without copying the pixel values back and forth between the two buffers (something like writing the text directly to pData)? Due to the way the system is designed, my function must work on preloaded BITMAPINFO* input that resides in memory, not bitmap image files or other types of input. And because my system needs all the speed it can get, any tips on how to make the above code faster will be greatly appreciated.
Thanks!
|
|
|
|
|
Indrawati wrote:
Is there a more efficient way to do this without copying the pixel values back and forth between the two buffers (something like writing the text directly to pData)?
nope. not if you're using the GDI text functions - they require DCs, and DCs require HBITMAPs and HBITMAPs require you to SelectObject them, etc.. if you want to get into 3rd party text-rendering engines, you might be able to avoid it, but that's probably a lot more trouble than it's worth.
Software | Cleek
|
|
|
|
|
How can I Highlight a CTreeCtrl Item, without set focus on CTreeCtrl?
|
|
|
|
|
Sounds like you need to make sure the tree control has the TVS_SHOWSELALWAYS style.
|
|
|
|
|
right! thank you. but when no focus, the color turns to grey, instead of blue.
|
|
|
|
|
Sure, but that's the way the control works. Highlight a file in Explorer, and give focus to another window - you get the same effect.
|
|
|
|
|
|
Hello,
I have trouble with the following few lines:
int CGoalsListView::GetItemFromPoint(CPoint point)<br />
{<br />
<br />
int nItem = 0;<br />
<br />
CRect rcItem, rcItemClient;<br />
nItem = 0;<br />
....
In the debugger, I see that as soon as the instruction for nItem = 0; executes, all locals change as though the stack just got slammed by something: nItem now equals some very large number, and the point is rewritten.
Any ideas about why this is occuring and how to fix it?
thanks,
JennyP
|
|
|
|
|
|
error C2440: '=' : cannot convert from 'std::string' to 'System::String __gc *'
How can solve this problem?
Please help me
|
|
|
|
|
ozgul wrote:
How can solve this problem?
By showing us the code in context.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
My code is;
#include "stdafx.h"
#include "SysInfo.h"
#using <mscorlib.dll>
#using <system.dll>
using namespace System;
using namespace System::Data;
using namespace System::Net;
using namespace System::IO;
using namespace System::Text;
using namespace std;
int _tmain()
{
SysInfo sysInfo = new SysInfo();
String* uriString;
String* postData;
uriString = "http://localhost/WebApplication3/WebForm1.aspx";
WebClient* myWebClient = new WebClient();
myWebClient->Headers->Add(S"Content-Type", S"application/x-www-form-urlencoded");
//postData = Convert::ToString(sysInfo.getCpuModel());
postData = sysInfo.getComputerName();
Byte byteArray[] = Encoding::ASCII->GetBytes(postData);
Byte responseArray[] = myWebClient->UploadData(uriString, S"POST", byteArray);
Console::WriteLine(S"\nResponse received was {0}",
Encoding::ASCII->GetString(responseArray));
}
|
|
|
|
|
i don't for your answer, but i'd like to give some advices.
ozgul wrote:
using namespace System;
using namespace System::Data;
using namespace System::Net;
using namespace System::IO;
using namespace System::Text;
if you are using System:: ,
you don't have to using parts of it... you can so delete the 4 lines following.
ozgul wrote:
uriString = "http://localhost/WebApplication3/WebForm1.aspx";
in general, we are talking about URL s, not URI s.
at last, where does your code crash (about what line) ???
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I assume you have a problem with the following line!
postData = sysInfo.getComputerName();
Is this correct!? Everything else looks fine IMO.
You should change it to read
postData = sysInfo.getComputerName().c_str();
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 Walliams (Little Britain)
|
|
|
|
|
I'm not familiar with the managed extension ...
did you try copying the C buffer of the std::string ?
something like :
std::string s;
yourSystemStringVariable = s.c_str();
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
visibly, you are trying to assign a string* with a string.
didn't you forget the address operator (& ) ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
A lot of thanks....
I changed this line
postData = sysInfo.getComputerName();
with
postData = sysInfo.getComputerName().c_str();
Then it worked very well.
Again thanks every body...
|
|
|
|
|
hello everyone,
I am trying to read in a list structure which is serialized as
m_DataPointerList.Serialize( ar );
where m_DataPointerList is defined as :
CTypedPtrList m_DataPointerList;
and class CDataPointer is declared as:
class CDataPointer : public CObject
{
public:
CDataPointer();
protected:
DECLARE_SERIAL(CDataPointer)
protected:
public:
unsigned long Time; unsigned char Channel;
unsigned char Rate;
public:
virtual void Serialize(CArchive& ar);
};
and defined as:
IMPLEMENT_SERIAL(CDataPointer, CObject, 1)
CDataPointer::CDataPointer()
{
}
void CDataPointer::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
ar << Time;
ar << Channel;
ar << Rate;
}
else
{
ar >> Time;
ar >> Channel;
ar >> Rate;
}
}
I am having some difficulties( i donno why?) in reading it in using the same serializing command ie:
m_DataPointerList.Serialize( ar );
is there any thing i am overlooking while i am doing this??
on the other hand,
I try to read this using a 'for' loop
which iterates for the number of occurances of CDataPointer. but i have to add an offset at the end of every iteration if I were to read the next iteration correctly.
something like
nDataCounter=ar.ReadCount();
for(i=0;i
{
ar>>Time[i];
ar>>Channel[i];
ar>>Rate[i];
ar.Flush();
pFile->Seek(offSET, CFile::current);
}
i dont understand why i have to provide this offset.and i have trouble choosing the correct offSET as it varies for different lists. again is there something i am doing wrong ?
Can please you give me some insight into these two issues??
Thanks a lot
|
|
|
|
|
sorry m_DataPointerList has to be defined as
CTypedPtrList<coblist,cdatapointer*> m_DataPointerList;
and not as typed wrongly
|
|
|
|