|
This is a tough one. I don't know quite how to ask it, nor even which forum to post it. So, here goes.
I'm working on a plug-in for an application called DesktopSidebar, a side panel that sorta emulates the Longhorn sidepanel. Anyway, in the SDK for developing plugins there is a C++ DLL sample, as well as a C# one because the application allows all .NET languages as well as standard C++ through COM Interop... so the plugins could even be done in VB.NET. At any rate, 99% of it works fine for me, except for when I specify the icon that's used in the "Add Plugin" dialog. In the C++ example the code is such:
char szPath[_MAX_PATH];
GetModuleFileName(_AtlBaseModule.GetResourceInstance(),szPath,sizeof(szPath));
std::stringstream panelIcon;
panelIcon<<szpath<<","<<idb_icons<<",0";
csidebar="" sidebar(psidebar);
="" sidebar.registerpanel(
="" "recyclebinpanel",
="" "recyclebin",=""
="" "recyclebin_desc",
="" panelicon.str(),
="" "system_cat",
="" ",254,4",
="" "",
="" plugincookie);
the="" resource="" in="" question,="" idb_icons="" (id="" is="" 100)="" a="" bitmap="" added="" to="" the="" project="" and="" resulting="" string="" for="" icon="" this="" case="" (at="" panelicon.str())="" "<path="">\DLLNAME.dll,100,0" I guess the main application can use that to query resource ID 100 (and maybe 0 is an offset or something.... because the bitmap contains 2 images side by side).
How in the world can you accomplish this is either VB.NET or C#? In both languages you can "embed" a resource by adding the bitmap to the project and changing it to "Embedded Resource". However, there is no indication of any sort of ID. I did quite a bit of digging and using Ildasm.exe I was able to look at my DLL and get the following:
.mresource /*28000002*/ public dsshutdown.icons.bmp
So, there's my embedded resource with an "ID" presumably of 28000002. However, using the same calling convention in my component as above, doesn't work at all... well I see a black blob. Also, if I use Resource Grabber and look at the C++ example built DLL it easily pulls the bitmap from the DLL. Using Resource Grabber on my DLL, however, doesn't show any bitmap at all even though it's clearly there. I know how to write code within .NET to pull out and use the resource. However, the call to "RegisterPanel" above wants a string.
Is there some other way to go about this? ... some way to put the image into my DLL in the same method as in C++ to make the application able to render my bitmap icon?
Thanks.
|
|
|
|
|
Hi guys,
When the application is minimized it takes a low prority, i found out this when i process a file in MDI application,The file that is processed in 20 secs when the application is not minimized, takes 1 min to process when the application is minimized. How shd i set high priority to my MDI application always.Is it safe to do this?,Will this affect the other system applications?, please explain.
Thanks
Krithika
|
|
|
|
|
Hi,
table containing two fields one is code and another is name. i need to fetch repeated names only.(more than one occurance of name and code is not same). any one help to me. thanks in advance.
Have A Nice Day!
Murali.M
Have A Nice Day!
Murali.M
|
|
|
|
|
try this
SELECT DISTINCT t1.code, t1.name
FROM mytable t1 INNER JOIN mytable t2
ON t1.name = t2.name
WHERE t1.code <> t2.code
ORDER BY t1.code
|
|
|
|
|
Is it possible to have an edit control wrap the text so that you don't have to press return in order to go to the next line? If so how?
Thanks.
- monrobot13
|
|
|
|
|
Hi
Set the properties of the edit box so that
Auto HScroll = false
Multiline = true
Paul Hooper
If you spend your whole life looking over your shoulder, they will get you from the front instead.
|
|
|
|
|
Thanks for the reply. I'll try that out.
- monrobot13
|
|
|
|
|
EDIT: I Solved my own problem
I moved my button-logic to the MainFrm.cpp class, and used the GetPane() function to access the correct pane. I guess the best solutions are the ones you come up with yourself.
********************************************************************************************
Original Post Below:
I've read a number of posts here about communicating when using splitters, but I'm still having a problem, so I'd appreciate any help. I have an SDI application with a toolbar and three views ... one of which is a CHtmlView derived view. I'm trying to control the web browser control using the toolbar buttons.
Here's what I have:
-------------------
I have a pointer to the MainFrm object in my MyApp.cpp (defined MyApp.h).
In my MainFrm.cpp, I'm using the RUNTIME_CLASS(CClassType) macro to create each of the three splitter panes, and I'm saving pointers to each views.
In MyApp.cpp, I have a message handler for the user clicking the "Back" button:
void CMyApp::OnBack(){
CMainFrame* p_localMainFrameRef = (CMainFrame*) p_viewMain;
CMyAppHTMLView* p_localWebFrameRef = (CMyAppHTMLView*)(p_localMainFrameRef->p_viewWeb);
p_localWebFrameRef->GoHome();
}
I'm getting the following error when I click the "Back" button:
Unhandled exception at 0x7c1a8130 (mfc71d.dll) in YourApplication.exe: 0xC0000005: Access violation reading location 0x00003972.
Can anyone lend some advice as to what I'm doing wrong ... or suggest a better approach to allowing me to communicate between frames, and with the toolbar?
Thanks very much,
telstar
|
|
|
|
|
Need to grey out the background of a ClistBox on pressing button grey on a dialog. The list can contain items which should also be greyed out and on pressing button enable list the list should be enabled with all its items
using wm_ctlcolor message with appropriate brush works, but when the list has items the portion with those items are white while rest is grey.
|
|
|
|
|
You have to enable the transparent background mode for the DC in the WM_CTLCOLOR method BEFORE returning the new brush:
HBRUSH CSampleDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
pDC->SetBkMode(TRANSPARENT);
if (pWnd->GetDlgCtrlID() == IDC_MYLISTBOX)
{
if(m_bGrayed)
return (HBRUSH)GetStockObject(GRAY_BRUSH);
else
return (HBRUSH)GetStockObject(WHITE_BRUSH);
}
return hbr;
}
Regards, mYkel
|
|
|
|
|
How can i use a DLL to link 2 different Static Lib in Visual C++ 6.0?
I need help URGENTLY!!!
Thank you very much...
|
|
|
|
|
As an advice if you have more than one dll loaded in ur application then you need to consider rebasing ur dll.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
Hello guys,
I am encountering a problem with serveral ComboBox objects created directly from the resouce editior of my dialog-based program. The style is drop-down with a pre-entered set of data. The comboboxes in Windows XP would appear fine, clicking the arrow on the side will show a dropdown list displaying all the item strings. But when running the app in Windows 98, the dropdown list only extends to the height which just occupies the first item. I can, however, go through previous/next items by using the up/down arrow keys. Further, if I then enable "Vertical Scrollbar", a vertical scrollbar will now be available on the dropdown list, which I can use to go through the items. In Windows XP, enabling vertical scrollbar does not make any difference. Clicking on the arrow still gives the complete dropdown list.
I am not sure why it happens? Does it sound like IDE related issue? I am using .Net 2002
Please help,
thanks alot
|
|
|
|
|
hi
I think the problem is u didnt pull down the extent of ur combo drop down in the resource view, Go to your resource view,get the respurce where ur combo is,click on the dropdown arrow,u will get a dotted box, pull it down to the extent u want to display the data
When u do this, vertical scroll appears automatically...
Thanks
krithika
|
|
|
|
|
Thanks for the reply, krithika,
I go back to the resource view and indeed there are two different selection boxes, when you click on the combobox conetent location and the drop-down arrows. I have extended the drop-down view box and hopefully it will make a difference. Will report back. Assuming it works, why it doesn't cause a problem when the app is running on Windows XP?
|
|
|
|
|
J.B. wrote:
why it doesn't cause a problem when the app is running on Windows XP?
The OS is compensating for the (very common) error of forgetting to set the combo box height properly.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Michael Dunn wrote:
The OS is compensating for the (very common) error of forgetting to set the combo box height properly.
That's exactly the mistake I made. Reszing Combobox's dropdown box height solves the problem in Windows 98.
Thanks guys
|
|
|
|
|
hi:
AS we know ,there are several CD_ROM track mode. The first one is CD_DA,The second one is MODE1 ,The last one is MODE2,which has two forms .
Who can help me?
Thank you very much.
|
|
|
|
|
I am writing an MFC dialog application where I have an edit box. If I know the start and end char's, what is the best way to get the substring? Any help is appreciated.
-Dev578
|
|
|
|
|
if you have the start and end indexes the use Mid()
str.Mid(start, end-start);
|
|
|
|
|
int begin = str.Find(char_begin);
int end = str.Find(char_end);
return str.Mid(char_begin + 1, char_end - char_begin - 1);
Robert-Antonio
"Life is very hard, if you apply E-R model to it."
|
|
|
|
|
I'm leaning English.I'm Korean.
I need that oldeDB use programming.
DB:MS-Access
language: visual C++ 6.0
I need sample code.
|
|
|
|
|
Check out the OLE-DB samples in MSDN, and the ATL support for OLEDB in ATLDBCLI.H
along with the online documentation for them.
They aren't (or should not be) specific to MS ACCESS, and have the advantage that they are reasonably lightweight compared to ADO.
Steve S
|
|
|
|
|
I am working on an on-screen keyboard replacement for Tablet PC's. I am using SendInput to send the characters. This works fine with "normal" windows. However, if a console window has the focus, it gets no output. I know that this can be done because the On-Screen Keyboard that comes with Windows XP does it. Can anyone point me in the right direction.
Thanks,
Dave
|
|
|
|
|
Check out MSDN.
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q190/3/51.asp&NoWebContent=1
Kuphryn
|
|
|
|