Access Violation if sending a fax failed

  • Thread starter Shiva Farzanehpour
  • Start date
S

Shiva Farzanehpour

Hi,
I am using the "Sending a Fax (C++)" example that it is available from MSDN,
located in the following URL:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxusing_8lyb.asp

If some error raised during sending fax, for instance the specified file not
found or file type has not been associated with any windows' applications,
the proper exception raised, but after executing catch block and the rest of
my function, I got "Access violation" error in debug mode, or closing my
application immidiately after the error is caught. Would you please help me
what is the reason of this problem and how I could solve it? Thanks a lot.

Best regards,
Sh. Farzanehpour
 
R

Renu Bhattar [MSFT]

I tried running the same code and got an exception of File not found but the
program exited properly after going through the catch loop and didnt
generate any access violation.

May be you are trying to use some variable after the catch loop that would
have been allocated memory if the program ran properly without any
exception.

Would be nice if you could share your code snippet.

---

Renu Bhattar [MSFT]

Microsoft Printing, Imaging and Faxing
This posting isprovided "AS IS" with no warranties and confers no rights.
Please do not send mail directly to this alias. This alias is for newsgroup
purposes only.
 
S

Shiva Farzanehpour

Thanks for your reply.it may be because I work incorrectly with smart
pointers (sipFaxServer and sipFaxDocument). I want to use them globally, so
I defined them ouside the main() block and this causes Access Violation. How
could I assigne these data as global variables that my other functions would
be able to use them?
Thanks,
Shiva
--------------------------------------
Renu Bhattar said:
I tried running the same code and got an exception of File not found but
the program exited properly after going through the catch loop and didnt
generate any access violation.

May be you are trying to use some variable after the catch loop that would
have been allocated memory if the program ran properly without any
exception.

Would be nice if you could share your code snippet.

---

Renu Bhattar [MSFT]

Microsoft Printing, Imaging and Faxing
This posting isprovided "AS IS" with no warranties and confers no rights.
Please do not send mail directly to this alias. This alias is for
newsgroup
purposes only.

Shiva Farzanehpour said:
Hi,
I am using the "Sending a Fax (C++)" example that it is available from
MSDN, located in the following URL:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxusing_8lyb.asp

If some error raised during sending fax, for instance the specified file
not found or file type has not been associated with any windows'
applications, the proper exception raised, but after executing catch
block and the rest of my function, I got "Access violation" error in
debug mode, or closing my application immidiately after the error is
caught. Would you please help me what is the reason of this problem and
how I could solve it? Thanks a lot.

Best regards,
Sh. Farzanehpour
 
R

Renu Bhattar [MSFT]

You can refer to the following webblog. It discusses the same problem.

http://blogs.msdn.com/larryosterman/archive/2004/04/22/118240.aspx

---

Renu Bhattar [MSFT]

Microsoft Printing, Imaging and Faxing
This posting isprovided "AS IS" with no warranties and confers no rights.
Please do not send mail directly to this alias. This alias is for newsgroup
purposes only.

Shiva Farzanehpour said:
Thanks for your reply.it may be because I work incorrectly with smart
pointers (sipFaxServer and sipFaxDocument). I want to use them globally,
so I defined them ouside the main() block and this causes Access
Violation. How could I assigne these data as global variables that my
other functions would be able to use them?
Thanks,
Shiva
--------------------------------------
Renu Bhattar said:
I tried running the same code and got an exception of File not found but
the program exited properly after going through the catch loop and didnt
generate any access violation.

May be you are trying to use some variable after the catch loop that
would have been allocated memory if the program ran properly without any
exception.

Would be nice if you could share your code snippet.

---

Renu Bhattar [MSFT]

Microsoft Printing, Imaging and Faxing
This posting isprovided "AS IS" with no warranties and confers no rights.
Please do not send mail directly to this alias. This alias is for
newsgroup
purposes only.

Shiva Farzanehpour said:
Hi,
I am using the "Sending a Fax (C++)" example that it is available from
MSDN, located in the following URL:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxusing_8lyb.asp

If some error raised during sending fax, for instance the specified file
not found or file type has not been associated with any windows'
applications, the proper exception raised, but after executing catch
block and the rest of my function, I got "Access violation" error in
debug mode, or closing my application immidiately after the error is
caught. Would you please help me what is the reason of this problem and
how I could solve it? Thanks a lot.

Best regards,
Sh. Farzanehpour
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top