|
AnayKulkarni wrote: Now what i have to do is, I want to display each line with different font in edit box means each line will have different font.
You'll have to use Rich Edit control for that purpose, because the edit box is not capable of showing text with different fonts.
If you are using MFC check out this[^] tutorial for the Rich Edit control.
If you are not using MFC than this[^] MSDN article could be useful for you.
|
|
|
|
|
File drag and drop operation initialize COleDataObject.
If i want to initialize it without drag and drop then how to create and initialize COleDataObject class object.
If i have a character array which contains some data then how to pass this array data to COleDataObject class object.
How to set a filename in COleInsertDialog without using its domodal method
|
|
|
|
|
MKC002 wrote: If i have a character array which contains some data then how to pass this array data to COleDataObject class object.
I suspect you'll need to use the Attach() or AttachClipboard() method.
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
If you are using LoadLibrary, you don't need to link to any library.
Where does this dll come from ?
|
|
|
|
|
I have created this dll and trying to call them.
First i got this error
"Error 1 error C2664: 'GetProcAddressW' : cannot convert parameter 2 from 'const char [6]' to 'LPCWSTR' c:\Users\Indumathi\Documents\Visual Studio 2005\Projects\Win32 DLL\Win32 DLL\NestedDLL.cpp 33"
To overcome this i added
_AddFunc = (AddFunc1)GetProcAddress(hInstLibrary,Text("MyDLL"));
After adding this Text command in GetProcAddress I got this error
<b>"Error 1 error LNK2019: unresolved external symbol "public: __cdecl std::exception::exception(char const *)" (??0exception@std@@QAA@PBD@Z) referenced in function "public: __cdecl std::bad_alloc::bad_alloc(char const *)" (??0bad_alloc@std@@QAA@PBD@Z) NestedDLL.obj ">
</b>
To solve this i added .lib file in the Additional Library in Linker tab
Once did that all the error went and i got this error
"Fatal error LNK 1180 cannot open input file"
I am new to VC++ and i have no idea how to solve this.
pls. help me to solve this.
|
|
|
|
|
Ok, so either you link to your library and call the functions direclty, or you use LoadLibrary and GetProcAddress. But it doesn't make any sense to link to your library and use LoadLibrary. I strongly suggest you read some tutorials about dlls (there are plenty of articles available on CP).
|
|
|
|
|
Is there an article for wince win32 dll.
Because I found many links and all for win32 projects and for smart device in VC++.If so, can u please give me the link.
.It would be grateful if send me the link
|
|
|
|
|
induvijay wrote: "Error 1 error C2664: 'GetProcAddressW' : cannot convert parameter 2 from 'const char [6]' to 'LPCWSTR' c:\Users\Indumathi\Documents\Visual Studio 2005\Projects\Win32 DLL\Win32 DLL\NestedDLL.cpp 33"
This is because you're either explicitly calling GetProcAddressW (which is not the best way of doing it) or your project is Unicode. In either case, you're using char , but you should be using wchar_t for the call to succeed. Or do an ANSI build, which would call GetProcAddressA .
It's time for a new sig. Seriously.
|
|
|
|
|
induvijay wrote: "Error 1 fatal error LNK1181: cannot open input file 'C:\Users\Indumathi\Documents\Visual.obj'"
You should fix this problem first. What is this file and why is the linker trying to include it?
It's time for a new signature.
|
|
|
|
|
I have no idea.even i searched in my local directory its not there.
I included my library file in the Additional Library include.once i did that this error occurs
|
|
|
|
|
From this and your comments above it would appear that you are somewhat new to C++ or programming in general. I would suggest you spend a little more time studying the basics before trying what looks like a more advanced project.
induvijay wrote: I included my library file in the Additional Library include.once i did that this error occurs
Obviously something in your build configuration is trying to include this file; take a look at the project properties to see where it is being called from.
It's time for a new signature.
|
|
|
|
|
|
Here[^] is a Microsoft article that should help you.
It's time for a new signature.
|
|
|
|
|
Hi, in my CTrendView derived from CScrollView,i added two scrollbars inside the view.
I created it in OnCreate function.
int CTrendView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CZoomView::OnCreate(lpCreateStruct) == -1)
return -1;
HScroll.Create(SBS_HORZ|SBS_TOPALIGN|WS_CHILD|WS_VISIBLE,CRect(10,10,200,15), this, 1);
VScroll.Create(SBS_VERT|SBS_TOPALIGN|WS_CHILD|WS_VISIBLE,CRect(200,50,230,200),this, 2);
}
And i added code for OnHScroll and OVScroll also.
void CTrendView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CRect r;
CClientDC d(pScrollBar);
HScroll.SetScrollPos(iHIndex,1);
int TmpiHIndex = iHIndex; biHIndexChanged = false;
if (pScrollBar == &HScroll)
{
if (nSBCode == SB_THUMBTRACK)
{
iHIndex = (int)nPos;
}
if (nSBCode == SB_LINEDOWN)
{
iHIndex++;
if (iHIndex > pScrollBar->GetScrollLimit())
iHIndex = pScrollBar->GetScrollLimit();
}
if (nSBCode == SB_LINEUP)
{
iHIndex--;
if (iHIndex < 0)
iHIndex = 0;
}
HScroll.SetScrollPos(iHIndex,1);
}
CView::OnHScroll(nSBCode, nPos, pScrollBar);
}
So my problem is when i scrolling the Window scroll,its not get scrolling.When i debug,i found after pressing windows scroll it goes to this OnHSCroll coding and actual scrolling is not working.What can i do?Help me.
Anu
|
|
|
|
|
What are you doing with the iHIndex later ?
You have to take that offset into account when you redraw your view.
|
|
|
|
|
Im using iHIndex in OnDraw() function
iHIndex = HScroll.GetScrollPos();
and assinging in SCROLLINFO
SCROLLINFO infoH;
infoH.cbSize = sizeof(SCROLLINFO);
infoH.fMask = SIF_ALL;
infoH.nMin = 0;
infoH.nMax = PageCount;
infoH.nPage = 1;
infoH.nPos = iHIndex;
infoH.nTrackPos = 1;
HScroll.SetScrollInfo(&infoH);
Im plotting some dynamic values as trend in a Rect and im using this scroolbar to scroll and see the previous trend.
THis scrollbar is working properly.
Problem in Window scrollbar,when i move that it,it again move to previous position.
Anu
|
|
|
|
|
I have a 32bit bitmap with alpha channnel . I am drawing it using gdi+ . but I am not getting the transparency . How to get the transparency usnig gdi+
Rajesh
|
|
|
|
|
How are you drawing it? Do you have any code you can share? (small piece)
|
|
|
|
|
Graphics graphics(hdc);//Handle to the device context
//Load the image from a file
Image image(L"test.bmp",FALSE); // test.bmp is 32bit with alpha channels for transparency
graphics.DrawImage(&image,0,0,image.GetWidth(),image.GetHeight());
Rajesh
|
|
|
|
|
You have to specify Colormatrix and load it via ImageAttributes'
SetColorMatrix() before using DrawImage()
Regards,
Spk
|
|
|
|
|
What will be color matrix values ???
Rajesh
|
|
|
|
|
Thats based upon your requirement... if you need to convert 80% of the bitmap alpha values use this sample one...
ColorMatrix colorMatrix = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.8f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
ImageAttributes imageAtt;
imageAtt.SetColorMatrix(&colorMatrix, ColorMatrixFlagsDefault,
ColorAdjustTypeBitmap);
Regards,
Spk
|
|
|
|
|
you understand wrong . I have 32bit bmp and talking about the alpha channel tranparency . not opacity of image .
Rajesh
modified on Friday, July 23, 2010 7:50 AM
|
|
|
|
|
If you call GetPixelFormat() on a 32-bit bitmap (.bmp) loaded with Image, it will return PixelFormat32bppRGB.
I've found that using PNG images works.
|
|
|
|