|
I need to multicast a bitmap image over the network with UDP and can't get it to work. Can someone please help me with full VC++ code to do this?
BoB
|
|
|
|
|
i got a response for my previous query about a thread variable and i got a feeling that i hav'nt explained the problem very clearly..so let me tell my problem again.
In my application i've to access a hardware and get some data from it, for which the vendor has supplied a BSP and few API calls.He says that for MFC applications i've to create an object of a class called TLV_STORE, which contains lot of static members associated with the board Library and ensure its lifetime overlaps all calls to the library function across different classes.
i've created the object in the InitInstance function(in the Heap using new operator) of the Class derived from CWinApp and i'm able to access the API calls of the board only from that class(i.e.when i try to access the API from a class derived from CDialog i'm getting Debug Asertion error).
is there any other place where i can declare the object so that it becomes visible to all the classes and i can access the API calls from different classes within in the application?
it will be really great if anyone can help me out in this.
rajeev
|
|
|
|
|
You can declare the variable as extern in stdafx.h
Implement it in some .cpp file.
In stdafx.h:
extern TLV_STORE g_Store;
In somefile.cpp:
TLV_STORE g_Store;
Initialize it somewhere in the program before using it.
this is this.
|
|
|
|
|
Hello,
Make a singleton for it:
class Single_TLV_STORE
{
public:
static TLV_STORE* Instance();
};
static TLV_STORE* Single_TLV_STORE::Instance()
{
static TLV_STORE TLVStore;
return &TLV_STORE;
}
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
-- modified at 9:04 Friday 16th September, 2005
|
|
|
|
|
Respected
All
How i can load a bitmap in Picture box ,,plz help with full VC++ code.
and also how i can refresh my dialogbox b/c some probelms are coming on device context.
david
|
|
|
|
|
CBitmap b;<br />
b.LoadBitmap(IDB_BTIMAP1);<br />
m_Static.SetBitmap(b);
You also have to set the "Type" to "Bitmap" in the Resource Editor.
About refreshing the dialog:
RedrawWindow();
this is this.
|
|
|
|
|
I'm Developing an application in which i need to create an object of the structure TLV_STORE and it should be visible to all the classes in my application.
i've created an object using "new" operator in the InitInstance and freeing it in the Exit Instance ,but the rest of my classes are unable to access certain functions because the object of TLV_STORE is not visible to them.
is there any other place where i can create the object so that it is alive & visible to other classes?
it will be really great if someone can help me out in this.
rajeev
|
|
|
|
|
1)Whats the meaning of "Thread variable" here ?
2)When you declare an Object of X class in InitInstance() it DOES not mean other classes must know this single instance of X class
3)
a) You have to include this following function in all your other classes
void SetMyObject(CXObject* obj)
b) And you must include a (private)member variable of X class object to be used by SetMyObject()
c) The definition of SetMyObject(CXObject* obj)
{
myPrivateXObj=obj;
}
Now ciao !!!! All your classes can use the Single Instance created at InitInstance() and can be deleted at ExitInstance()
redindian
|
|
|
|
|
rajeev82 wrote:
is there any other place where i can create the object so that it is alive & visible to other classes?
if you make it global, everyone can see it.
or, since everything can get to your CWinApp onject (via AfxGetApp), you can make that variable a member of, add some accessor methods to, your CWinApp class.
Cleek | Image Toolkits | Thumbnail maker
-- modified at 13:51 Friday 16th September, 2005
|
|
|
|
|
Hi all!
Would you help me to solute this problem.
here is my problem.
I changed my project from Japanesse to English (I only convert Strings).
I use VC++ 6.0 and Window XP(Enlish) to Compile two Release and debug verstions:
+ For English WindowXP , all of them run well.
+ For Japanesse WindowXP , only debug version run well but release version don't run.
Many thanks.
-- modified at 5:06 Friday 16th September, 2005
|
|
|
|
|
Check the Project setting of Debug and release .
Find out what dependency is missing in Release but not in debug
redindian
|
|
|
|
|
Hallo!
I have checked it.
My problem is here.
In Japanese Window OS, release version doesn't run. but it run well in English version OS.
|
|
|
|
|
Does anybody know of a good technique to detect if a TCP-port is open on a server, without fully connecting to it? I need to do a half-way TCP-connect, so that the server's accept() isn't executed. The server becomes quite "upset" if I just connect and disconnect, not adhering to its protocol. The protocol is proprietary, and I do not have the source code for the server, so I can't add my own tweaks to it. Hence I need to "fool" it on TCP-level.
I know there are implementations such as NMap out there, but I figured I'd ask here for the basic techniques first, before taking a plunge into complex multiplatform sources.
Note: I'm no dummy, so you don't have to give me tons of source code. Some hints would do just fine.
ps. I wouldn't be offended, should you give me code
--
An eye for an eye will only make the world blind.
|
|
|
|
|
I took print out of your query and went to desks of TCP experts , The answers
1) Call lsof on unix flavoured OSs
2) net stat -p tcp (u can use the rexec(IP , Cmd ) to execute this command at the remote server , but i am not sure of rights issues of RPC )
3) Ethreal tool can help (but u r searching for code ..almost useless)
P.S : not sure of the rexec() function name . Which OS u r talkign abt ?
|
|
|
|
|
I thought it was obvious that I'm talking about Windows, especially considering the fact that this message board is called "Visual C++".
Anyway, I need to do it programatically, so I can't just launch a second process, or make it a manual operation for the end user to do.
|
|
|
|
|
In fact I replied to your message (but shows "Ananymous" as I di dnot log in while replying)
redindian
|
|
|
|
|
As you know the server IP + port ,you can filter the netstat -p command's results and find if the port is established or not . Right ?
redindian
|
|
|
|
|
I don't want to establish a connection - it confuses the server, because I don't follow the protocol. I just want to detect the presence of an open port on a particular IP address.
I've found the TCP state charts, and it seems that all I need to do is to send a TCP/SYN-message, and wait for a TCP/SYN_ACK message. Then I know there is a process listening on that port. Then my plan is to send a TCP/RST to reset that connection sequence, thus preventing the server from acquiring a socket.
|
|
|
|
|
|
Thank you for that link! Unfortunately it makes use of win/libpcap, which has a rather fascist license requirement, which states I must reproduce the copyright information. :grumble:
It's on my list though, in case I don't find something else. So, once again, thank you!
|
|
|
|
|
|
I m planning to write a Voip dialer that can be used as net 2 phone dialer. Can any one provide me any kind of source code for this?
|
|
|
|
|
Hi,
How to Remove Help button from CPropertysheet. i have tried in this way, but no result. help me in this regard. Urgent.............
sheet.m_psh.dwFlags &= ~PSH_HASHELP;
page1.m_psp.dwFlags &= ~PSH_HASHELP;
page2.m_psp.dwFlags &= ~PSH_HASHELP;
page3.m_psp.dwFlags &= ~PSH_HASHELP;
page4.m_psp.dwFlags &= ~PSH_HASHELP;
sheet.DoModal();
it is still appearing.
bye
|
|
|
|
|
|
Hi
I am having problem about EndRequest()function of class CHttpFile Function.it is
taking too much time to execute..Instead of that if i am using Win
APIs it is running ok...
I am getting response but is taking much time that is the main problem
it takes apprx. 1 min.
So Can any body suggest me what can be the problem..?
sonani prakash
|
|
|
|