Firewire communication #2

Hi guys,

   I am trying to interact with a camera through firewire. I wrote a
code based on the example given in MSDN.  When I execute the code it
always return the value 1 no matter whether the device is connected or
disconnected. Please let me know what went wrong, i couldnt figure out
the problem so for.


Advanced Thanks
- Mike


My code is as follows.
--------------------------------------

void CFireDlg::OnDeviceNotify()
{
	// TODO: Add your control notification handler code here
   CString cs;

   bool bDevInterResult=FALSE;
   HDEVNOTIFY *hdn=NULL;

   bDevInterResult = DoRegisterDeviceInterface(GUID_MP1394MI,hdn)!=0;
   cs.Format("Device notification : %d",bDevInterResult);
   MessageBox(cs);

}


BOOL CFireDlg::DoRegisterDeviceInterface(GUID InterfaceClassGuid,
HDEVNOTIFY *hDevNotify)
{
    DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
    char szMsg[80];

    ZeroMemory( &NotificationFilter, sizeof(NotificationFilter) );
    NotificationFilter.dbcc_size =
sizeof(DEV_BROADCAST_DEVICEINTERFACE);
    NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
    NotificationFilter.dbcc_classguid = InterfaceClassGuid;

    hDevNotify = (void **)RegisterDeviceNotification(GetSafeHwnd(),
&NotificationFilter, DEVICE_NOTIFY_WINDOW_HANDLE);

    if(!*hDevNotify)
    {
        wsprintf(szMsg, "RegisterDeviceNotification failed: %d\n",
                GetLastError());
        MessageBox((const char*)GetSafeHwnd(),szMsg, MB_OK);
        return FALSE;
    }

    return TRUE;
}

--------------------------------------

0
1/24/2006 3:50:42 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
453 Views

Similar Articles

[PageSpeed] 41

Not sure, I can play and see what happens but it won't be anytime soon.

I feel it won't fail and what you see is normal,
 just that you will get notifications via WM_DEVICECHANGE
when you add or remove a new device.

-- 
Vipin Aravind

<meenakshi78@gmail.com> wrote in message 
news:1138074642.080368.214340@f14g2000cwb.googlegroups.com...
> Hi guys,
>
>   I am trying to interact with a camera through firewire. I wrote a
> code based on the example given in MSDN.  When I execute the code it
> always return the value 1 no matter whether the device is connected or
> disconnected. Please let me know what went wrong, i couldnt figure out
> the problem so for.
>
>
> Advanced Thanks
> - Mike
>
>
> My code is as follows.
> --------------------------------------
>
> void CFireDlg::OnDeviceNotify()
> {
> // TODO: Add your control notification handler code here
>   CString cs;
>
>   bool bDevInterResult=FALSE;
>   HDEVNOTIFY *hdn=NULL;
>
>   bDevInterResult = DoRegisterDeviceInterface(GUID_MP1394MI,hdn)!=0;
>   cs.Format("Device notification : %d",bDevInterResult);
>   MessageBox(cs);
>
> }
>
>
> BOOL CFireDlg::DoRegisterDeviceInterface(GUID InterfaceClassGuid,
> HDEVNOTIFY *hDevNotify)
> {
>    DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
>    char szMsg[80];
>
>    ZeroMemory( &NotificationFilter, sizeof(NotificationFilter) );
>    NotificationFilter.dbcc_size =
> sizeof(DEV_BROADCAST_DEVICEINTERFACE);
>    NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
>    NotificationFilter.dbcc_classguid = InterfaceClassGuid;
>
>    hDevNotify = (void **)RegisterDeviceNotification(GetSafeHwnd(),
> &NotificationFilter, DEVICE_NOTIFY_WINDOW_HANDLE);
>
>    if(!*hDevNotify)
>    {
>        wsprintf(szMsg, "RegisterDeviceNotification failed: %d\n",
>                GetLastError());
>        MessageBox((const char*)GetSafeHwnd(),szMsg, MB_OK);
>        return FALSE;
>    }
>
>    return TRUE;
> }
>
> --------------------------------------
> 


0
vipin (696)
1/24/2006 4:01:45 AM
Reply:

Similar Artilces:

More than 5 emails in 2 seconds
I recently upgraded my cable internet to the 5 meg version. It is now capable of pushing a lot of data back and forth in a hurry. Outlook baulked at sending out seven small emails that were sitting in the outbox, with a popup error saying that it violated an Outlook rule (which I know I didn't write). Can someone point me to the area where this is controlled, or explain? thx What rules do you have in place? What version of Outlook? What's the exact error message? Smiff wrote: > I recently upgraded my cable internet to the 5 meg version. It is now > capable of pushing a l...

On change event #2
Hi all, I have two fields, one numeric and another datetime. I would like the datetime field to be updated automatically whenever the number field is populated by a number. If later on that number changes, I don't want the datetime field to be updated accordingly. Can someone guide me on how to create this ? Thanks in advance, Ziv ...

converting from Quicken 2004 #2
Hi! I'm sure this has been asked before, but I did do a search on Quicken in this group and I didn't find it. So please forgive me if I'm rehashing something. I just downloaded Money 2004 and tried converting my Quicken 2004 file and it's not converting. Does the Money converter not yet convert a Q2004 file? what are my options? Thanks! Bruce In microsoft.public.money, Bruce wrote: > >I'm sure this has been asked before, but I did do a search on Quicken in >this group and I didn't find it. So please forgive me if I'm rehashing >something....

2 (or More) MSCRM's talking to each other
Wondering whether anyone has done any work on linking up two or more different instances of MSCRM. e.g. Parent comapny has the master MSCRM. Subsidaries have their own MSCRM instances. The Subsidary MSCRM's need to send their data to the Master one regularly. It seems possible based on the availability of the API's but I would appreciate any feedback on this. cheers Mark If we assume the company and subs are all part of a big wide area network and are all in one active directory tree then yes it would be possible but the level of code required would be so great you might as w...

Date problem #2
I am trying to add a date function to my spreadsheet. I want it to display the date that a certain value was entered. So far, all attempts have resulted in a date that reupdates everytime I reopen excel. Is there a function that will insert current date and make it static? Thanks Your post has an April 6 date on it and today is only April 2. Did you check your PC clock 1st? That may fix your problem. Steve "Drew Reed" <drewreed@comcast.net> wrote in message news:g6SdnVUsNNQQ-tPfRVn-iw@comcast.com... > I am trying to add a date function to my spreadsheet. I want it ...

Is .NET 4.0 a replacement of 2.0?
When .NET upgraded from 2.0 to 3.0 (and again to 3.5), 3.0 and 3.5 weren't really totally new versions of .NET. They required 2.0 to be there and were more of an extension or and add-on to 2.0. What about .NET 4.0? Is it a complete framework all on its own? Or does it require 2.0 (and/or 3.x)? TIA CSharpner wrote: > When .NET upgraded from 2.0 to 3.0 (and again to 3.5), 3.0 and 3.5 > weren't really totally new versions of .NET. They required 2.0 to be > there and were more of an extension or and add-on to 2.0. > > What about .NET 4.0? Is it a comple...

Registration Issues #2
I reinstalled my copy of Office from the disc after a hard-drive replacement was done at my local Apple store, then left for a study abroad program. I forgot to copy my product keys and had to have them sent to me by my family, but the Test Drive had already expired. Now, I can't find any way to input my product keys and the program is locked! Do I have to get them to mail the cd halfway around the world or is there a way I can still register the install I have on here? I'm not really clear on your situation, but if I understand correctly you've reinstalled Office (2004?) without...

Can I split 1 cell into 2 cells in Excel?
I am working in a spreadsheet where I frequently use the filter and sort functions. I want to split one cell into two in one column, I don't want to use two columns and merge the rest of the cells as this upsets the filter/sort functions. Try this.... Highlight the required cells you want to split and DATA > TEXT TO COLUMNS > NEXT then enter the parameter that you want to split by (colon, space, etc) FINISH "Chalky" wrote: > I am working in a spreadsheet where I frequently use the filter and sort > functions. I want to split one cell into two in one column...

page size #2
Please help me with this. I cannot for the life of me get the right margin to be at the 1/2 inch it is set to be. When I print the invoice that I created, it is about an inch wide on the right. I have used the page preview and moved margins and page size around, but to no avail. I am stuck. Thanks in advance, Jeff Hi, Please, no repeat posting on the same day. First, if your data doesn't extend far enough to the right to reach the 1/2 inch margin, it will look like there is a larger margin. A few options - in the spreadsheet widen a few columns of the print area. On th...

Is it possible #2
So I have a spreadsheet that has in each cell a code that looks like the following "NYL5". What I want to do is take the 4th character in this code with is always number and add them all together in a column and then calculate the average. Is this possible at all? If so can you tell me how? Thanks, stuck :confused: -- carley465 ------------------------------------------------------------------------ carley465's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=28085 View this thread: http://www.excelforum.com/showthread.php?threadid=475906 To get th...

WLM Beta 2 Contacts
I have many business contacts where the name of the contact is the name of the company. Is there a way to get the company name to show in my contact list? It seems that WLM only displays personal names. Thanks Colin In WLM Beta 2 one can view Contacts in List or Messenger Status mode. In List mode, one can change or add additional columns(e.g. Name, Nickname, Company) -- ....winston ms-mvp mail "Colin Grant" wrote in message news:ukYd8uuPLHA.4280@TK2MSFTNGP05.phx.gbl... I have many business contacts where the name of the contact is the name of the comp...

Disclaimer Message #2
I am running Exchange 2k3 with sp2. I followed the instructions in http://support.microsoft.com/default.aspx?scid=kb;en-us;317680 to create a disclaimer to outgoing emails using vb script. I am able to customize the message, but I can't put any different styles to it. I would like to change the font type, size and color but it won't seem to take any commands. I'm definitely not an html coder so I've been trying to figure out how to make it work. I have created the message I want, and it works correctly when I put it into html checkers. But when I put it in the vbs, the...

Excel password #2
Hi Gurus My app uses the Excel COM server to load spreadsheets and read/write data in it. I am having a hard time finding how I would know if a spreadsheet is password protected before having tried to load it. The COM exception which is raised when a password protected spreadsheet is loaded, cannot be reliably assumed to be that due to a missing password, because it is a general COM exception. Any help would be greatly appreciated. -- Rahul Kumar http://dotnetyogi.blogspot.com This message is provided "AS IS" with no warranties, and confers no rights. Any opinions or policies stat...

Passport Login fails #2
Anybody have any experience with passport not authenticating in Money 2004? I get the following error: The sign-in attempt for {my passport id} was unsuccessful. Please try your sign-in name and password again. My MSN Messenger 6.1 and my Pocket PC Messenger both login in fine from the same machine the Money is installed on. Any ideas would be greatly appreciated. Thanks! Methinks Money is not using a "normal" Passport login. Money simply refuses to log in via Passport through my firewall (Microsoft ISA), but is fine outside the firewall, even through ZoneAlarm. I have used ...

Circular logging question #2
If I create a new store with circular logging enabled, do I still need to restart the information store service? Thank you. Circular logging is activated at the Storage Group level. The GUI will prompt you to take all DBs offline and then online. Circular should never be used on back end servers. /Simon "justsimplequestions" <sigmatechnology@googlemail.com> wrote in message news:1173981863.481309.98010@o5g2000hsb.googlegroups.com... > If I create a new store with circular logging enabled, do I still need > to restart the information store service? > > Thank yo...

CRM Professional Edition 1.2
I received this product with my MAPS. Can I install it on a Windows SBS 2003 system? yes - be sure to read/follow the implementation guide (on the documentation CD) - there's a complete chapter on installing into SBS2003 - Also - there is an update of that chapter on the Microsoft support download site. - "jc" <jc@discussions.microsoft.com> wrote in message news:AAD7E0B5-563B-4154-B4FB-5FE73CB4A176@microsoft.com... >I received this product with my MAPS. Can I install it on a Windows SBS >2003 > system? Yes, I found out how. There is an update to BCM t...

Excel 97 #2
I am trying to do the following in Excel and not succeeding - any chanc of some help. I have two arrays of date and time. Arrays are different lengths. want to compare one element of array A to all elements of array B, an do this for all elements of array A. Say there are n elements in array A. A, B, C and D are all arrays For i = 0 to n-1 C = B - A(i) : create a new array C C = Abs(C) : convert values of C to absolute value e.g. ABS(-2.5) 2.5 Position = min_pos(C) : find array position of smallest element o array C Min_difference = C(position) D(i) = Min_difference Next i Cheer...

Exchange Server 5.5 Help #2
Hello, Is there a way to set out of office reply on the email server rather than at the client's machine? because when the client's machine is off, no reply will be sent. I am using exchange server 5.5 with internet mail connector. Thank You leo7802@hotmail.com (Leo) wrote: >Hello, > >Is there a way to set out of office reply on the email server rather >than at the client's machine? because when the client's machine is >off, no reply will be sent. I am using exchange server 5.5 with >internet mail connector. > >Thank You Out Of Office messages are c...

i m using one Pst One Email-id but 2 system mail are coming 2 copy
i m using Microsoft Outlook 2003 . using one E-mail ID and one PST file but I m using in 2 different Systems . mail are coming 2 copy what is solution. i want one copy only Saravanakumar, you wrote on Mon, 19 Mar 2007 02:05:15 -0700: > i m using Microsoft Outlook 2003 . using one E-mail ID and one PST > file but I m using in 2 different Systems . mail are coming 2 copy > what is solution. i want one copy only Uncheck the option "Leave a copy on server" (or similiar): Tools | E-Mail-Accounts | Existing E-Mail-Accounts There select the email account, click on "...

Nested formular to give a word answer based on 2 cells
I have a s/s which I want to produce a statement based on 2 cells G170 is a cell that contails a sum (if cells above are filled it it will add them up) I170 contains a cost if G170 & i170 are blank then do nothing If G170 is greater than 0 and I170 is greater than 0 then again do nothing but if G170 is greater than 0 and I170 is = < 0 then "No Charge Made" Can anyone help all I get is FALSE I have tried =if(g170<=0, and (i170=<0,No Charge made","")) Hi, =IF(AND(G170="",I170=""),"",IF(AND(G170>0,I170...

Money locks up #2
Whenever I try and open Money, nothing happens, everytime I have to close the program because it is not responding, I have tried reinstalling, but nothing works. Advice would be helpful. Thanks In microsoft.public.money, mattmtv wrote: >Whenever I try and open Money, nothing happens, everytime I have to close the >program because it is not responding, I have tried reinstalling, but nothing >works. Advice would be helpful. Try opening Money by double-clicking on the sample.mny in your Money install folder. If that works, suspect a problem with your Money file rather than the ...

Consuming Axis 1.2 Service with .net vb client
Hi, I have a problem consuming a webservice using a .net client written in vb. I used a wsdl to generate the proxy class and it worked like a charm. Sending requests to the service is not a problem. Even complex custom types are received and processed by the service. When it comes to receive the response from the service, complex types produce an error like: Error in xml document (1,130), which occurs in System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) bei System.Xml.Serialization.XmlSerializer.Deserialize...

VB.NET 2003 and Crystal Reports 9.2.3
When I add a report designed under Crystal Reports 9.2.3 into my VB.NET project I get the error message "Cannot find custom tool 'CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator' on this system." Does anybody know how to fix this problem? Thanks, disaia@verizon.net Change "custom tool" from 'CrystalDecisions.VSDesigner.C=ADodeGen.ReportCodeGenerator' to 'CrystalDecisions.VSShell.C=ADodeGen.ReportCodeGenerator' ...

Free/busy problem #2
I have an exchange 5.5 server, which for various reasons, the schedule+ free/busy folders are gone/corrupted/not working. I set up a new exchange 2003 server in co-exist mode, and moved some mailboxes over to it. Now, users on the exch2003 still cannot see free/busy info for each other. I checked and there is a free/busy system folder on the new exch2003 server, but I think it's still trying to get the info from the old screwed up server. Is there a way to get the 2003 server to be the "main" one for schedule+ F/B? Define "co-exist mode" since that is a nonstand...

CRM upgrade from 1.2 to 3.0 with SQL instance fails
Hello, The Microsoft CRM 3.0 server does not upgrade my basic CRM 1.2 server. When it is checking the server requirements, I get a couple of errors like "MachineName value SQL1\CRM is invalid" and "The SQL Server 'SQL1\CRM' is unavailable". I am hosting the CRM databases on a seperate SQL 2000 instance. I can validate that the CRM 1.2 server has no problems accessing the database server because everything is working. Here is what the help says when I click on the error: Named Instance Microsoft SQL Server Found Cause Setup has found that you are trying to ...