|
Let me be specific I am writing a debugger and stream in the program listing. On the left hand side I have a one byte area for the user to in put a command like ‘B’ for breakpoint
Thanks
|
|
|
|
|
Very interesting, in a non-specific way. I am sure you do have a specific question, but I have no idea what it is.
|
|
|
|
|
I stream in the program TEXT from the Z/OS Assembler SYSADATA I then did SEL(0,-1) and changes it to RTF Courier New before displaying it, I would like to enter text
for example here is a line "_ 204 00004A LA R4,QDINIT " Where the Hyhpen is I would like to let the user enter a letter "B' but the entire text is protected
I have been doing research and it seems with the setevnetmask with a notification for a change I would get an en_chnage message and the doc says it I return 0 another message gets sent I am wondering if I
process this message would be able get to set the text modify (for example the B) it. Don't know if I am on the right track with this. All I really want to do is let the user enter text in this now RTF
richedit this should be possible after all Word is an RTF editor and you can modify the text even if its Rich Text (formatted with fonts)
Thanks
|
|
|
|
|
No idea what is happening there. I have used RichEdit controls and never had such a problem. Try a straightforward RichEdit control and don’t do anything to modify its settings to see what happens.
|
|
|
|
|
thanks that's all I was looking for from the way you see it I should be able to modify the text, I did a SetWindowText to the Richedit e.g. this is a test message and was able to type in it the rich edit control
thanks for your help if from the way you see it I should be able to modify the text Ill research the problem
|
|
|
|
|
Hi ,
can u please help me to read XLSX file without office automation
i read XLS file using ODBC Driver.
but XLSX file read by this driver not found please help me how can do this.
thanks for any help and guidance in advance
|
|
|
|
|
|
|
thanks for reply
but i want to ask one thing these .Net dll can use in my mfc VC++ application.
|
|
|
|
|
Whoops! Sorry, I thought this was a C# question.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
its ok plz provide me any help for my mfc vc++ application
|
|
|
|
|
In the past for just basic files I have used
GitHub - brechtsanders/xlsxio: XLSX I/O - C library for reading and writing .xlsx files[^]
Note the 3 limitations
1.) assumes the first row contains header names
2.) assumes the next rows contain values in the same columns as where the header names are supplied
3.) only values are processed, anything else is ignored (formulas, layout, graphics, charts, ...)
CSV has easily become the more normal interchange and as its as simple as "save as" in excel it's rare anyone bothers with raw excel file anymore. They can do all there fancy graphs etc in excel itself and just export the data
In vino veritas
|
|
|
|
|
|
Le@rner wrote: ...but XLSX file read by this driver not found What exactly is this supposed to mean?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
It means what it says
He has a current version of Excel but the XLSX file is from and older version and that earlier driver isn't installed on the machine.
Microsoft ODBC drivers simply call prior version drivers to load older version XLSX files they don't of themselves read older versions.
The message is correct even if a bit humorous
Now ask me the real funny question can you tell what version an xlsx file was created from
Well yeah if you have HexEditor the BIFF in the beginning of file header will have a tag XL9, XL10, XL12 etc.
Find that old Driver, Download that driver, install and you are away .. simple for an end user hey
In vino veritas
|
|
|
|
|
I've been working on this for a few days and I can't seem to get it. I just want to load a bitmap from file, resize it, then attach it to a CImageList obj via the Add() Member function.
I'm using LoadImage() to load the bitmap into memory from disk.
HBITMAP hbmp = (HBITMAP) ::LoadImage(..) ;
I can display the bitmap just fine using pDC->DrawState(…, , hbmp);
I've tried creating a memoryDC and a Compatible Bitmap like this:
HDC hClientDC = GetDC()->m_hDC;
HDC hMemDC = NULL;
HBITMAP hMemBitmap = NULL;
//create compatible memory area
hMemDC = CreateCompatibleDC(hClientDC);
hMemBitmap = CreateCompatibleBitmap(hMemDC, cx, cy);
But, then I can't seem to copy anything into it. I'm a noob, so I'm just lost here.
Can anyone help?
EW.
|
|
|
|
|
|
|
At no point at you actually selecting the bitmap onto the DC, or bitblt or anything that would actually move the bitmap onto the DC
This is usual code for doing it
HDC BitmapToMemDc (HBITMAP hBmp)
{
HDC hMemDC = 0;
if (hBmp != 0)
{
hMemDC = CreateCompatibleDC(NULL);
if (hMemDC)
{
SelectObject(hMemDC, hBmp);
}
}
return hMemDC;
}
For a bitmap file you have it right LoadImage and then use the above
HDC MemDCFromBMPFile(char* Filename)
{
HDC MemDC = 0;
HBITMAP bmp = LoadBitmapFromFile(Filename);
if (bmp != 0)
{
MemDC = BitmapToMemDc(bmp);
DeleteObject(bmp);
}
return MemDC;
}
For completeness GIF, JPG's etc are a little more tricky you need to use Ipic
Ipic will also load bmp and png and you can rescale any file with the Ipic->Render line and it isn't to bad
It's resize is much better than stretchblt
#include "olectl.h"
HDC MemDCFromJPG_GIF_File(char* filename)
{
const int HIMETRIC_PER_INCH = 2540;
WCHAR OlePathName[512];
SIZE sizeInHiMetric;
IPicture* Ipic = NULL;
HDC MemDC = 0;
MultiByteToWideChar(CP_ACP, 0, filename,
(int)strlen(filename) + 1, &OlePathName[0], 512);
HRESULT hr = OleLoadPicturePath(OlePathName, NULL, 0, 0,
IID_IPicture, (LPVOID*)&Ipic);
if ((hr == S_OK) & (Ipic != 0))
{
int Wth, Ht;
HDC Dc = GetDC(NULL);
int nPixelsPerInchX = GetDeviceCaps(Dc, LOGPIXELSX);
int nPixelsPerInchY = GetDeviceCaps(Dc, LOGPIXELSY);
ReleaseDC(NULL, Dc);
Ipic->get_Width(&sizeInHiMetric.cx);
Ipic->get_Height(&sizeInHiMetric.cy);
Wth = (nPixelsPerInchX * sizeInHiMetric.cx +
HIMETRIC_PER_INCH / 2) / HIMETRIC_PER_INCH;
Ht = (nPixelsPerInchY * sizeInHiMetric.cy +
HIMETRIC_PER_INCH / 2) / HIMETRIC_PER_INCH;
MemDC = CreateCompatibleDC(0);
if (MemDC)
{
BITMAPINFO bi = { 0 };
DWORD* pBits = 0;
bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bi.bmiHeader.biBitCount = 32;
bi.bmiHeader.biWidth = Wth;
bi.bmiHeader.biHeight = Ht;
bi.bmiHeader.biCompression = BI_RGB;
bi.bmiHeader.biPlanes = 1;
HBITMAP bmp = CreateDIBSection(MemDC, &bi, DIB_RGB_COLORS,
(void**)&pBits, 0, 0);
if (bmp)
{
SelectObject(MemDC, bmp);
Ipic->Render(MemDC, 0, 0, Wth, Ht, 0,
sizeInHiMetric.cy, sizeInHiMetric.cx,
-sizeInHiMetric.cy, NULL);
DeleteObject(bmp);
}
}
Ipic->Release();
}
return MemDC;
}
In vino veritas
modified 19-Nov-19 5:23am.
|
|
|
|
|
Thanks for the help Leon!!
I did manage to get the bmp code working good, however, I noticed as I compressed the bmp further and further with StretchBlt() it got ugly...
When I tried using your JPG/GIF loading code, was it supposed to proc a Dlgbox? or no? I had some trouble with the LPOLESTR converting from my program... but I think I got that fixed... here's the code:
HDC MemDCFromJPG_GIF_File(CString filename, int iWidth, int iHeight)
{
const int HIMETRIC_PER_INCH = 2540;
SIZE sizeInHiMetric;
IPicture* Ipic = NULL;
HDC MemDC = 0; // Preset return value to fail
BSTR b = filename.AllocSysString();
LPOLESTR pOLE_stringpath = b;
HRESULT hr = OleLoadPicturePath(pOLE_stringpath, NULL, 0, 0,
IID_IPicture, (LPVOID*)&Ipic); // Load the picture
if ((hr == S_OK) & (Ipic != 0)) // Picture loaded okay
{
...
However, the Ipic pointer is returning NULL every time? I don't know how to fix that??
Thanks again for your help!
Ryan.
|
|
|
|
|
Did you take note of the comment
Due to the way OLE works filename must be fully qualified (ie c:\folder\a.jpg)
That is usually the first port of call to why OleLoadPicturePath fails.
In vino veritas
|
|
|
|
|
Maybe it's so close to me I just can't see it. I have an application of a little north of 100K of source. I need to determine how much static allocation is going on and from where. Traditionally, I would just ask for a map file where it would list all of this out. But the VS2008 map file is useless. Lots of data, no real information. Am I missing something? I need the section that shows me where static variables are being allocated.
cg
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Hi Charlie,
It's been a while since I've worked with the Debug Interface Access SDK[^] but I believe the Dia2dump Sample[^] will dump all of your allocated variables along with with size and location.
Best Wishes,
-David Delaune
|
|
|
|
|
Oh if this works, Christmas has come early! I'll check it out.
Thanks
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
charlieg wrote: Oh if this works, Christmas has come early! I'll check it out. You make it sound as if you are the only developer that has ever had this requirement. There are dozens of commercial and open source products that have the capability.
List of performance analysis tools[^]
Intel VTune is probably the easiest to use and has a lower learning curve. There is also a free trial version.
Best Wishes,
-David Delaune
|
|
|
|