|
Hi
In my system some ports are blocked.How can i know which ports are blocked.Is there any solution to find the above problem.please kindly help me and Give me a solution.
#sanroop#
|
|
|
|
|
Sanroop wrote: In my system some ports are blocked
Blocked by who/what?
|
|
|
|
|
Blocked by Networkadministrator .That b;locked port required to find out programatically.
#sanroop#
|
|
|
|
|
The only way I know is using UPnP. The device blocking the ports needs to support UPnP and
UPnP needs to be enabled on the device. I don't know how many network admins allow this, since
allowing applications to open ports through firewalls and/or NAT devices negates the security.
This article may help:
Using UPnP for Programmatic Port Forwardings and NAT Traversal
[^]
|
|
|
|
|
what are the reserved resource IDs of MFC by frame work.
Warm Regards,
Mushq
|
|
|
|
|
What you want to achieve ?
Refer winuser.h for set of ids used by windows.
dialog command ids'
#define IDOK 1
#define IDCANCEL 2
#define IDABORT 3
#define IDRETRY 4
#define IDIGNORE 5
#define IDYES 6
#define IDNO 7
#if(WINVER >= 0x0400)
#define IDCLOSE 8
#define IDHELP 9
#endif /* WINVER >= 0x0400 */
Cursor Id's
#define IDC_ARROW MAKEINTRESOURCE(32512)
#define IDC_IBEAM MAKEINTRESOURCE(32513)
#define IDC_WAIT MAKEINTRESOURCE(32514)
#define IDC_CROSS MAKEINTRESOURCE(32515)
#define IDC_UPARROW MAKEINTRESOURCE(32516)
#define IDC_SIZE MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */
#define IDC_ICON MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */
#define IDC_SIZENWSE MAKEINTRESOURCE(32642)
#define IDC_SIZENESW MAKEINTRESOURCE(32643)
#define IDC_SIZEWE MAKEINTRESOURCE(32644)
#define IDC_SIZENS MAKEINTRESOURCE(32645)
#define IDC_SIZEALL MAKEINTRESOURCE(32646)
#define IDC_NO MAKEINTRESOURCE(32648) /* not in win3.1 */
#if(WINVER >= 0x0500)
#define IDC_HAND MAKEINTRESOURCE(32649)
#endif /* WINVER >= 0x0500 */
#define IDC_APPSTARTING MAKEINTRESOURCE(32650) /* not in win3.1 */
#if(WINVER >= 0x0400)
#define IDC_HELP MAKEINTRESOURCE(32651)
#endif /* WINVER >= 0x0400 */
Icons id's
#define IDI_APPLICATION 32512
#define IDI_HAND 32513
#define IDI_QUESTION 32514
#define IDI_EXCLAMATION 32515
#define IDI_ASTERISK 32516
#if(WINVER >= 0x0400)
#define IDI_WINLOGO 32517
#endif /* WINVER >= 0x0400 */
#else
#define IDI_APPLICATION MAKEINTRESOURCE(32512)
#define IDI_HAND MAKEINTRESOURCE(32513)
#define IDI_QUESTION MAKEINTRESOURCE(32514)
#define IDI_EXCLAMATION MAKEINTRESOURCE(32515)
#define IDI_ASTERISK MAKEINTRESOURCE(32516)
#if(WINVER >= 0x0400)
#define IDI_WINLOGO MAKEINTRESOURCE(32517)
#endif /* WINVER >= 0x0400 */
#endif /* RC_INVOKED */
#if(WINVER >= 0x0400)
#define IDI_WARNING IDI_EXCLAMATION
#define IDI_ERROR IDI_HAND
#define IDI_INFORMATION IDI_ASTERISK
#endif /* WINVER >= 0x0400 */
|
|
|
|
|
These are WinUser resources. MFC resource IDs are located in afxres.h (which in turn includes also winres.h). You may want to check also the .rc files located in Platform SDK in ../mfc/src.
Nuclear launch detected
|
|
|
|
|
|
Hi all:
I wonder how the icon for the items in A/R program dialog is set?
|
|
|
|
|
Set the following reg value
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*MyProduct*\
ValueName: DisplayIcon
Value: C:\MyProg\MyProg.exe,0 (0 being the icon no in the resource)
If you think you can than you can, if you think you can't you are right.
|
|
|
|
|
This is the code i am trying in visual studio 2005.
char *str = new char[100];
delete [] str;
strcpy ( str, "good_moring" );
cout<
|
|
|
|
|
The results of operation on a deleted pointer are *undefined* (thats why you should set the pointer to null right after deleting it)
If you think you can than you can, if you think you can't you are right.
|
|
|
|
|
Because the page in the process's virtual address space that str pointed to is not released right away. In fact it would probably get re-used if you immediately called new again.
In short: it's luck and it's a bug to access memory after using free/delete on it.
|
|
|
|
|
The operator new allocates the space and assigns an address to the variable. The operator delete only marks that memory as re-usable, it does not change the assigned pointer. Your code will not throw any errors because all strcpy will do is check theat the address points to memory, it will not check if it is usable or not.
If in your test code you allocated and used more memory after deleteing str and before strcpy , you may find that the same memory is being used. The golden rule is, set the address to NULL directly after calling delete .
|
|
|
|
|
thanks...
so better to follow the goldern rule.
|
|
|
|
|
pyarigopal wrote: still its printing good_morning with out throwing any exception.
why this is happening ?
Perhaps delete is only marking the memory chunk as free and strcpy doesn't matter about, as stated by MSDN:
The strcpy function copies strSource, including the terminating null character, to the location specified by strDestination. No overflow checking is performed when strings are copied or appended
try this:
char *p = new char[100];
delete [] p;
char *q = new char[100];
strcpy(p,"Hello world\n");
strcpy(q,"Good news...\n");
printf("%s", p);
printf("%s", q);
if you're a lucky boy, like me, you will see the following output:
Good news...
Good news...
hence you're loosing the freed memory.
As already stated by other posters, NEVER DO SUCH NASTY THINGS.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
to add to all replies, use strcpy_s and take benefit of Security Enhancements in the CRT.
|
|
|
|
|
Hi all,
I have creating dialog based window in vc++(MFC) and installed image magic(dynamic dll of binary version).
I need to know about InitializeMagic(char *) function. Is Magic must be initialize?... and when i read one image using read(std::string) function.....
#include Magick++.h<br />
#include iostream<br />
using namespace std;<br />
using namespace Magick; <br />
<br />
{<br />
Image img;<br />
img.read("c:\\logo.jpg");<br />
}
Error will be thrown like......
Unhandled exception at 0x000c256.. in sample.exe:0xC000075:
Access voilation writing location 0xcde....
Anybody know about this problem let me know...
Thankx in advance...
|
|
|
|
|
I think you asked like this question you can also use of GDI+ or CImage class for read graphic files.(jpg,gif,png,..)
|
|
|
|
|
Hi WhiteSky,
Just now i had read your previous reply, Sorry.......
I dont want that just read one image and save to another file. My target is convert multipage PDF file into image file with good resolution for OCR process. Can i use GDI+ or CImage for this conversion...
|
|
|
|
|
I think no but see here[^] if its helpfuls
|
|
|
|
|
But there is only Image to PDF converter
|
|
|
|
|
Hi,
I need to write an injection module for my application.
Which one would be the best. Code Injection or DLL Injection. What are the advantages over the other...
Heard that, DLL injection can be used in all the windows OS. but code injection can be applied only on NT Operating sys.
Is there any other advantages or problems in using either of them..
Please advice me.
Thanks.
~ Selva
|
|
|
|
|
To my mind "DLL injection" is a form of "Code Injection". If the code in question is complex DLL injection is the easiest way to get your code into another process. If you attempt to inject raw code you lose actions the loader performs which we all take for granted such as automatic code relocation; not to mention the fact that compilers build DLL's not "naked" code.
Steve
|
|
|
|
|
Thanks Steve.
I will just go with DLL Injection in that case.
~ Selva
|
|
|
|