|
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.
|
|
|
|
|
Can you share with some piece of code for help me
Rajesh
|
|
|
|
|
It's exactly the same, just load a .PNG file that has an alpha channel.
|
|
|
|
|
bResult = AddPrinterDriver(NULL, 3, (LPBYTE) &di3);
TRACE("%d", (int) GetLastError());
if (!bResult)
return FALSE;
The call to AddPrinterDriver fails returning FALSE, and GetLastError() returns ERROR_IO_PENDING. The Error Lookup tool shows for this error "Overlapped I/O operation is in progress."
What does this mean, and what should I do to work around this problem?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
If i check out the documentation of AddPrinterFriver[^], it doesn't mention anywhere that it sets the last error code in case of an error, are you sure you are not getting the error code of something called before AddPrinterDriver OR maybe something that was called inside AddPrinterDriver but doesn't really contain much of information about the problem?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Strange, it used to say:
If the function fails, the return value is zero. To get extended error information, call GetLastError() .
"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
|
|
|
|
|
Hi all,
I am trying to read a file from a device connected to a serial port. I am using CreateFile() and ReadFile() methods to read the file. But my problem is when i am not using FILE_FLAG_OVERLAPPED parameter my processing becomes slow. I wanted to know why this is happening??
Can anybody help me in this?
Thanks in advance
|
|
|
|
|
I think that is quite hard to guess without actually seeing what you do and how you do it. My guess is that without overlapping your program blocks on the read operatin until there's data available to be read so the processing becomes "blocky". Do you know the difference between overlapped and non-overlapped IO?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
If you have not read it before you MUST read: http://www.flounder.com/serial.htm[^]
You'd think working with a serial port be easy, but it's far from.
Good luck,
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|