|
Thanks a lot. I will look into it.
--
Christoph
|
|
|
|
|
Hi,
I want a notification for the usb device connection and disconnection in vc++ DLL.
I am implementing J2534 DLL in that i want a notification for usb device connect and disconnect.
I read about WM_DEVICECHANGE notification and RegisterDeviceNotification.
but RegisterDeviceNotification will give error "undeclared identifier".
and both will use window handle.
if i use these functions in my DLL i wont get the window handle.
so anybody give me the solution to implement the same.
and one more thing i have found one example code to achieve the same.
this code uses AtUsbHid.dll to detect usb connect and removal.
but to use these dll functions also i need to pass window handle which is not possible in DLL.so if anybody knows the solution to use same dll without window handle.
Thanks in advance
|
|
|
|
|
Why can't you just create a hidden window that can receive the WM_DEVICECHANGE notification?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Its a really bad practice to open hidden windows in dlls, cause you never can use these dlls
in services on vista or later.
Greetings
Covean
|
|
|
|
|
If you are creating a service, then you can use RegisterDeviceNotification() to receive notification.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Yes you are right about this Register function, I only meant, not to open a hidden window
in a dll if you do not know if it can be used later in the context of a service.
Greetings
Covean
|
|
|
|
|
yes u r right creating hidden window in a dll is a bad habit.
but what ever i am implementing its not a service also.
so please suggest me some alternative solution to achieve this.
i found hid dll and i am checking that now.
anybody have idea about HID dll.can i use this dll to implement my reuirement.
|
|
|
|
|
So if you are sure not to use it in service the easiest way really will be to open a hidden window.
If you wanna try your luck with the hid.dll, then I would be pleased to hear how you solved the problem,
cause this is an interesting issue.
Greetings
Covean
|
|
|
|
|
still i have check with HID.dll i am not sure.
meanwhile if anybody suggest some other way to solve this problem then i will be very thank full to them.
|
|
|
|
|
Hi
How can I identify the version of WTL i am having in my machine.
There are major changes done in AtlDlgs.h between WTL 7.1 version and WTL 7.5 version.
modified on Wednesday, November 11, 2009 9:48 AM
|
|
|
|
|
Hi,
I believe the WTL version is defined in the atlapp.h header as _WTL_VER
Best Wishes,
-David Delaune
|
|
|
|
|
/* Program for multiplication of two matrices */
# include <stdio.h>
# include <conio.h>
# define ROW 3
# define COL 3
void main()
{
int mat1[ROW][COL],mat2[ROW][COL],mat3[ROW][COL];
int i,j,k;
clrscr();
printf("\n Enter matrix mat1(%dx%d)row-wise:\n ",ROW,COL);
for(i=0;i<ROW;i++)
{
for(j=0;j<COL;j++)
{
scanf("%d",&mat1[i][j]);
}
printf("\n Matrix 1 is %d \n",mat1[i][j]);
printf("\n Enter matrix mat2(%dx%d)row-wise:\n ",ROW,COL);
for(i=0;i<ROW;i++)
{
for(j=0;j<COL;j++)
scanf("%d",&mat2[i][j]);
}
printf("\n Matrix 2 is %d \n",mat2[i][j]);
}
//Multiplication
for(i=0;i<ROW;i++)
for(j=0;j<COL;j++)
{
mat3[i][j]=0;
for(k=0;k<COL;k++)
mat3[i][j]+=mat3[i][j]+mat1[i][k] * mat2[k][j];
}
// End of multiplication
printf("\n The Resultant matrix mat3 is: \n");
for(i=0;i<ROW;i++)
for(j=0;j<COL;j++)
printf("\n %d",mat3[i][j]);
printf("\n");
getch();
}
main yeh program ka code run kara raha hoo par ismein kuch logical error hai
jo main remove nahi kar paa raha hoo.plzzzzzzzz help me..
|
|
|
|
|
ok, what's the question ?
you have compilation errors ? logic errors ?
did you run this with the debugger ?
did you try using a pen and paper to simulate your algorithm ?
This signature was proudly tested on animals.
|
|
|
|
|
I think you gotta check your for loop bracing.
Please put your question in English.
Also a bit prettier printing would help yourself in understanding your code.
You might want to put it in a code block after running it through "indent".
--
Christoph
|
|
|
|
|
|
I write some code, but can't get result.
Bitmap* pBitmap = new Bitmap(L"bitmap1.bmp");<br />
<br />
TextureBrush* pTextureBrush = new TextureBrush(pBitmap);<br />
<br />
graphics.FillRectangle(pTextureBrush, 50,300,200,80);
or
CString str = _T("N00.bmp");
int strLen = 0;
strLen =str.GetLength();
WCHAR* ch = new WCHAR[strLen];
wcscpy(ch, CT2CW(str));
Bitmap* pBitmap = new Bitmap(ch);
TextureBrush* pTextureBrush = new TextureBrush(pBitmap);
graphics.FillRectangle(pTextureBrush, 50,300,200,80);
|
|
|
|
|
kk_Kevin wrote: ...but can't get result.
Why not? What is failing? What does FillRectangle() return?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
I also don't know why, and it can not show nothing?
mybe the "bitmap::FromResource(..)" is wrong, and I do not know.
I try any way I can think out to resolve it, but, I can't
|
|
|
|
|
kk_Kevin wrote: mybe the "bitmap::FromResource(..)" is wrong, and I do not know.
Does it return a non-NULL value?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
first, the bmp pic "**.bmp" is in the res file of my project.
second, if I use Bitmap* pBitmap = Bitmap::FromFile(..); , the rectange can be filled. and use Bitmap::FromResource(..) can not.
thrid, I use ::FindResource(..) , but can not find the bmp
hInstResource = AfxGetApp()->m_hInstance;
src = _T("N00.bmp");
int strLen = 0;
strLen =src.GetLength();
WCHAR* ch = new WCHAR[strLen];
wcscpy(ch, CT2CW(src));
Bitmap* pBitmap = Bitmap::FromResource(hInstResource , CT2CW(src));
graphics.DrawImage(pBitmap, 75,35);
TextureBrush* pTextureBrush = new TextureBrush(pBitmap, WrapModeTileFlipY);
graphics.FillRectangle(pTextureBrush, 50,300,200,80);
Color m_penColor(233,100,54);
Pen pen1(m_penColor, 1);
graphics.DrawRectangle(&pen1, 50,300,200,80);
modified on Thursday, November 12, 2009 6:59 AM
|
|
|
|
|
kk_Kevin wrote: thrid, I use ::FindResource(..), but can not find the bmp
What does it return?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Is this C++ .NET (never developed in the language)?
If this is C++ .NET then I would think this will work (you have to check the syntax, cause of
my lack in skills in programming C++ .NET)
graphics.DrawImage(pBitmap, 50, 300, 200, 80);
Greetings
Covean
|
|
|
|
|
"graphics.DrawImage()" doesn't show any bmp pic
|
|
|
|
|
kk_Kevin wrote: "graphics.DrawImage()" doesn't show any bmp pic
What does it return?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
I have a Win32 Service (written in C) that does a CreateProcess(). After that it waits for its own termination (the services').
I would like to monitor the subprocess such that the service gets notified when the subprocess terminates (for whatever reason).
I have an idea of doing this with events and WaitForMultipleObjects(), but somehow I'm missing the idea where to start.
Should the service create an event? Or should the subprocess do that? And how would that be notified to the service process so that it can wait for that event?
Help very much appreciated.
--
Christoph
|
|
|
|