|
I get ERROR_FILE_NOT_FOUND from that. (Which to me seems like a reasonable thing, since the number character is valid in a windows path.)
Adding "file://" in front will bring up the correct file, but always shown from the top.
Removing "#alocation" also works (in that it brings up the correct file, but not located at the anchor point obviously).
WinXP IE6
I still doubt that it works for you.
|
|
|
|
|
ah, sorry, it was the anchor that matters... have you tried passing te anchor parameter into the "parameters" argument ?
like this (this one, i didn't test) :
::ShellExecute(NULL, _T("open"), _T("C:\\afile.htm"), _T("#alocation"), NULL, SW_SHOWNORMAL);
|
|
|
|
|
Been there, done that.
Right now it feels like I've tried every single possibility but the right one.
Maybe one should use another function altogether? Or is it even impossible, since I'd like it to work with Firefox et al aswell, depending on default browser? I don't want to add browser dependencies to the code.
|
|
|
|
|
The file: URL parsing has changed in IE 7.0 to be stricter. That means you may see differences between IE 6.0 and 7.0.
See here[^] for how to properly construct a file: URL.
|
|
|
|
|
i'm trying my hand at subclassing a control in an mfc dialogue app. i've seen examples on-line of subclassing the CButton and CStatic classes. however, the class wizard in visual studio 2005 does not give me these classes in the Base Class combo box. has the class wizard changed from earlier versions?
thanks for the help!
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello,
I have a tabbed control with three tabs. Each tab has a tree control. Each one of these is its own dialog. I have the parent tabbed control dialog in a CDialog bar so that it can dock to the main window. I am trying to make this main CDialogBar resizable but it seems to be locked and will not resize. When I pass the parameter of CBRS_SIZE_DYNAMIC to the CDialogBar, and when I click on the barder of the dialog bar, the mouse will change to the mouse icon you get when you go to resize a window, but the CDialogBar boarder does not move so I do no get the WM_ONSIZE message.
Any suggestions on how I can get my CDialogBar to resize?
I have some code at the bottom, this is how I am making my CDialogBar.
Thanks,
Shane
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
m_wndDialogBar.Create(this,IDD_DISPLAYDIALOG, WS_VISIBLE|WS_CHILD|CBRS_LEFT|CBRS_SIZE_DYNAMIC, 1);
m_wndDialogBar.SetWindowText("Display Control");
m_wndDialogBar.SetBarStyle(m_wndDialogBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); //| CBRS_SIZE_DYNAMIC
m_wndDialogBar.EnableDocking(CBRS_ALIGN_RIGHT|CBRS_ALIGN_LEFT);
DockControlBar(&m_wndDialogBar);
m_wndDialogBar.DelayShow(FALSE);
|
|
|
|
|
I am trying to do image bit manipulation on a 32 bit image, using the data from an 8 bit gray scale image to modify the 32 bit image's alpha values.
However, when I loop through the bits, and assign the value of the gray scale image to the 32 bit image I seem to get weird distortions. If I simply bitblt the the gray image to the 32 bit image, the resulting picture of the 8 bit image looks correct.
So what am I missing? Is there something special you need to do when sequentially accessing 8 bit image data?
Both images are created with the CreateDIBSection() API.
The 8 bit creation looks like this:
bmpInfo->bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
bmpInfo->bmiHeader.biWidth = width;
bmpInfo->bmiHeader.biHeight = -height;
bmpInfo->bmiHeader.biPlanes = 1;
bmpInfo->bmiHeader.biBitCount = 8;
bmpInfo->bmiHeader.biCompression = BI_RGB;
bmpInfo->bmiHeader.biSizeImage = width * height;
bmpInfo->bmiHeader.biClrUsed = 256;
RGBQUAD* colors = &bmpInfo->bmiColors[0];
for ( int i=0;i<bmpInfo->bmiHeader.biClrUsed;i++ ) {
colors->rgbBlue = i;
colors->rgbGreen = i;
colors->rgbRed = i;
colors->rgbReserved = 0;
colors ++;
}
hbmp_ = ::CreateDIBSection ( dc_, bmpInfo, DIB_PAL_COLORS, (void **)&data_, NULL, NULL );
Now my understanding is that the bits are now acessible via the data_ member. This is simply an unsigned char* variable.
I should be able to access any pixel of the gray scale image like so:
unsigned char& pixel = data_[(y*bmpInfo->bmiHeader.biWidth)+x];
Whats the grayscale image looks like after a bitblt:
http://vcf-online.org/pics/grayscaleimage.png[^]
What the composited 32bit image looks like after sequentially iterating through all the pixels of the image and applying the value of the grayscale pixels to the 32 bit image's alpha:
http://vcf-online.org/pics/image-alpha.png[^]
The second one is obviously screwed up, but I'm not seeing where the problem is.
|
|
|
|
|
Just a guess, but the fact that the distortions are running diagonally across the picture points me to byte alignment. I am not sure of the exact specs (would have to look that up and am too lazy at the moment) but the data for each row has to be aligned on a DWORD boundary. If the bitmap is an odd width, and you simply traverse and change the data without taking the alignment into account you would get the kind of thing you are seeing.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Yeah I just realized that too. I'm now trying to figure out what the stride should be. Any ideas on how you work that out?
|
|
|
|
|
#define WIDTHBYTES(__bits) (((__bits) + 31) / 32 * 4)
// for 8-bits
DWORD wb = WIDTHBYTES(8 * widthPix8)
// for 1-bits
DWORD wb = WIDTHBYTES(1 * widthPix1)
|
|
|
|
|
bmpInfo->bmiHeader.biWidth = width;
LONG stride = (bmpInfo->bmiHeader.biWidth + 3L) & 0xFFFFFFFCL;
...
bmpInfo->bmiHeader.biSizeImage = stride * height;
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
i need algorithm to compress image
|
|
|
|
|
As in compress - do you mean byte size (disk file size) - or do you mean shrinking the image dimensions? As well - what language?
|
|
|
|
|
didn't you compress your question too much ?
|
|
|
|
|
toxcct wrote: didn't you compress your question too much ?
he he he
|
|
|
|
|
Sure, compress it.
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
VuNic wrote: ress: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
i think i need to log on more hic hic hic
|
|
|
|
|
PNG is quite good for images with large areas of solid colour; JPEG is better for photographic images, where there's a lot of colour variation in small areas.
As for how to implement them, I'd look at libpng[^] and libjpeg[^].
|
|
|
|
|
In a MDI application that will have several Forms/Dialogs. Where is the best place to initialize my main class that will act as my main loop / finite state for the whole application. There are 4 dialog / forms that used to controls and change setting within object within the main loop class / finite state machine.
Scott Dolan
Jernie Corporation
Engineering & Manufacturing
Software, Hardware, & Enclosures
|
|
|
|
|
You could do it the MFC way and have a single application class instance. Initialization is
in the constructor, before WinMain is called. Additional calls on the object could be made in
WinMain.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Hi...
What if I use GetModuleHandle(L"abc.ocx") in the InitInstance() of the of the App class derived from 'COleControlModule'...of the ActiveX control "abc.ocx" ?
Will I get the Handle or it will return NULL....?
I have encountered controls, in some of them..handle is found and in others its NULL...
Wat is the reason behind this behavior..?
Can any one explain?
...A Programmer may or may not be the master of the programming language grammar...
|
|
|
|
|
I'm not sure, why you are doing this ? you can ger module handle any way, if its of same control.
|
|
|
|
|
Thnx for the reply...
Now here's the scene...when I compile the control....I get the handle...but when it is used in a container.....it gives NULL...
I want to know why is it giving NULL in a container...
Can you help me with this?
...A Programmer may or may not be the master of the programming language grammar...
|
|
|
|
|
You have not answered question asked by me. Why you are doing this, me there are other,easier ways to get its module handle, using CWinApp::m_hInstance for instance.
|
|
|
|