|
Steve_Harris wrote: I think that a bridge DLL is what I need.
Not when you are tied to VC6.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
This [^] looks promising on the road of Yes/Yes/Yes.
[added]
of course I missed,
Steve_Harris wrote: VC6
(I got only VS )in your request. Uhm, as already pointed out by jhwurmbach, the road seems much more difficult then
[/added]
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.
[my articles]
modified on Thursday, January 10, 2008 11:00:39 AM
|
|
|
|
|
A bridging COM dll is the way to go but you probably won't be able to write it in VC6. From the VC6 side tlaking to a COM Dll is fine and from the .NET side COM Interop works really well but somewhere along the line you've got to write the COM interop code with a newer Visual Studio.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Yeah, I gathered that. If I could find some code that largely reproduced CScrollView in .NET, and let me show pages on-screen whose dimensions were lifted from the current printer settings, then I could go about updating the MFC code, but I've yet to find something that does that. *Sigh*
|
|
|
|
|
Hello,
I'm very interested in using Richard Stringer's Printing Class Library ( http://www.codeproject.com/KB/printing/printlib.aspx )to generate simple financial paper reports (numbers in a grid, essentially). This library, while very advanced, appears to be incapable of displaying multiple pages, or wrapping data onto a new page.
Has anyone had any success in using these classes to print multiple pages? Could someone suggest a class for printing arbitrarily lengthed financial data, complete with print preview?
Thanks a lot,
Sternocera
|
|
|
|
|
I have the code to read xml.where i used xml parser to read and write.but i am unable to update attribute in xml.plz do the needful.
my code is..
try
{
MSXML2::IXMLDOMProcessingInstructionPtr pPI = NULL;
MSXML2::IXMLDOMDocument2Ptr pXMLDoc = NULL;
MSXML2::IXMLDOMNodePtr pNode = NULL;
MSXML2::IXMLDOMNodeListPtr pXMLDomNodeList = NULL;
MSXML2::IXMLDOMNodePtr pRootNode= NULL;
EVAL_HR(CoInitialize(NULL));
// Create MSXML DOM object
EVAL_HR(pXMLDoc.CreateInstance(("Msxml2.DOMDocument.4.0")));
// Step 1: Creating the Processing Instruction
pPI = pXMLDoc->createProcessingInstruction
("xml", "version='1.0' encoding='UTF-8'");
_variant_t vNullVal;
vNullVal.vt = VT_NULL;
pXMLDoc->insertBefore(pPI, vNullVal);
// ---------------------------------------------
// Step 2: Creating the Root Element
_variant_t varNodeType((short)MSXML2::NODE_ELEMENT);
pRootNode= pXMLDoc->createNode(varNodeType,
("Root"),(""));
pXMLDoc->appendChild(pRootNode);
// ------------------------------------------
// Step 3: Creating Attribute Node
MSXML2::IXMLDOMNodePtr pAttNode= NULL;
// Step 4: Creating attribute name element
MSXML2::IXMLDOMAttributePtr pattIdAttr = NULL;
pattIdAttr= pXMLDoc->createAttribute(("Name"));
pattIdAttr->nodeTypedValue = ("Namevalue");
pAttNode->attributes->setNamedItem(pattIdAttr);
//doc.DocumentElement.AppendChild(newElem);
//xe.Element("address").SetElement("city", "MANCHESTER");
pXMLDoc->save("D:\\Book1.xml");
}
catch(...)
{
}
CoUninitialize();
thanking you
sharan
Hi,,
I am sharan.Working as a software Engineer in Indo-Fuji Software Company located in BTM Layout.Bangalore.India.
I have Completed my B.E(COmputers)in 2006.ANd I am having 2 years of Exp in VC++.
thanking you
sharan
|
|
|
|
|
I see no error checking. Could any of the methods you are calling be returning an error status?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
sharanu wrote: pAttNode->attributes->setNamedItem(pattIdAttr);
The above line is wrong, since pAttNode is NULL .
I changed that line with
pRootNode->attributes->setNamedItem(pattIdAttr);
and the file was correctly created (with the attribute added to the root element).
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.
[my articles]
|
|
|
|
|
i am using freeimage and see the code
fipImage m_image;
BYTE *byte= m_image.getScanLine(somevlaue);
Now do not want to use the freeimage can any one help me
(please not use MFC)that I have a bitmap file and get
the same byte pointer of Scanline of bitmap image
Trioum
|
|
|
|
|
|
I'd give you some sample code if you can provide more specifics.
Are the "bitmap" files always .BMP files or do you want to support
other file types?
Can you use ATL or only straight Win32 APIs?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
at present I am using only .bmp files then will use other file format
(i.e.jpeg ,png gif,tga etc).
I am using only plan sdk (win32 only).
Trioum
|
|
|
|
|
For BMP files, here's a simple method...
HBITMAP hBitmap = (HBITMAP)::LoadImage(NULL, _T("C:\\Some.bmp"), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE);
if (hBitmap)
{
DIBSECTION DibSection;
::GetObject(hBitmap, sizeof(DibSection), &DibSection);
LONG scanline = ...;
BYTE *pScanlineBytes;
if (DibSection.dsBmih.biHeight > 0)
pScanlineBytes = (BYTE*)DibSection.dsBm.bmBits + (DibSection.dsBm.bmWidthBytes * ((DibSection.dsBm.bmHeight - 1) - scanline));
else
pScanlineBytes = (BYTE*)DibSection.dsBm.bmBits + (DibSection.dsBm.bmWidthBytes * scanline);
::DeleteObject(hBitmap);
}
For other file formats, you need to either parse the file yourself and provide any
decompression necessary, or you can use a third-party library. For Win32 in C++
you can use GDI+ to load png, jpeg, tiff, gif, exif, and bmp. If you want to use
GDI like the code above once the image is loaded, then the GDI+ Bitmap::GetHBITMAP()
method will give you a DIBSection handle (HBITMAP) from a GDI+ Bitmap object.
If you can use C++, I would recommend using the ATL CImage class. It will handle all the
image types that GDI+ handles, and has simple methods for accessing scanlines as I've
demonstrated above.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Sure - I'll send an email.
You may want to remove your email from your post to avoid
extra spam
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi everybody,
In MFC the new frames,views and controls appears in there own way.
So it seems ugly for the user if the new window opens under blitting...
I used the technique of LockWindowUpdate, which works great ... Under XP
Under Windows Vista this don't seem to work, the new frame opens in 2-4 steps
which seems very ugly
Does anyone knows this effect? Maybe also the correct technique to work around the problem?
Big thanks in advance
|
|
|
|
|
Hi, i am using FindWindow() function to get the handle of a dialog in one process from some other process. Can anybody tell is that correct or any problem in using the handle of a window in one process from some other process.
Thanks
|
|
|
|
|
A handle is actually a memory address. The handle (AKA: memory address) which you get from another process may be invalid to current process, because each process has its own view to memory (memory paging issue).
Maxwell Chen
|
|
|
|
|
I disagree. A window handle is unique on the system. You can post messages to the window whose that handle is assigned. At the end PostMessage is an IPC mechanism.
BTW handles technically are not memory addresses.
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.
[my articles]
|
|
|
|
|
CPallini wrote: I disagree. A window handle is unique on the system. You can post messages to the window whose that handle is assigned. At the end PostMessage is an IPC mechanism.
There is a translation mechanism.
CPallini wrote: BTW handles technically are not memory addresses.
The type void* is memory address.
typedef void* HANDLE;
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: There is a translation mechanism.
Maxwell Chen wrote: The type void* is memory address.
The type void* is a number that may contain a memory address. Since the window handle of a particular window is the same on different process (this, for instance, allows you to use in your application the handle found with Spy++ tool) and the processes have different address spaces, then window handles cannot be valid memory pointers in the context of such processes (at least IMHO ).
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.
[my articles]
|
|
|
|
|
CPallini wrote: The type void* is a number that may contain a memory address.
I am not sure, but if it is just a number, a ULONG is just fine. Since it is defined as a pointer type (void* ), it must be some address pointing to something.
CPallini wrote: Since the window handle of a particular window is the same on different process (this, for instance, allows you to use in your application the handle found with Spy++ tool) and the processes have different address spaces, then window handles cannot be valid memory pointers in the context of such processes (at least IMHO ).
I guess that creating handle and free handle are something related with global allocating memory blocks in the heap. Maybe it would be similar (not 100%) to this kind of thing below (I do not have VC++ now, not sure ).
struct MyBlock
{
int a;
};
void main()
{
MyBlock* p = new MyBlock;
p->a = 3;
}
struct MyBlock
{
int a;
};
void main()
{
void* p = reinterpret_cast<void*>(0x00A30210);
cout << reinterpret_cast<myblock*>(p)->a;
}
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: I am not sure, but if it is just a number, a ULONG is just fine. Since it is defined as a pointer type (void*), it must be some address pointing to something.
(1) Just a number? a memory address is a number. An window handle is more than a memory address: it is a unique number in the system context (i.e. the same for all processes) identifying a window.
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.
[my articles]
|
|
|
|
|
I mean why it is not defined as below?
typedef ULONG HANDLE;
Maxwell Chen
|
|
|
|
|
I don't know, but I can guess that 64-bit version of Windows use 64-bit HANDLE s.
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.
[my articles]
|
|
|
|