|
Hello Guys..
This is hari..i need some help regarding VC++...the problem iam not able to load an icon to a button in App Runtime..ie. iam selecting an icon in the App and it is loaded on the Button...guys help me to come out of it
Thanks in Advance..
Hariharan.S.N
|
|
|
|
|
use LoadImage
and set the fuload to LR_LOADFROMFILE
The World is getting smaller and so are the people.
|
|
|
|
|
I think ur problem is loading icons (or images) at runtime, from files.
MFC 7.0 solves this problem with CImage class, check the docs for details.
U can also search this site. There are button classes here that u can use instead.
What would life be without programmers and salesmen?
|
|
|
|
|
I have a CPropertySheet derived class; I need to implement the CPropertySheet::RemovePage(int nPage)
Would you tell me how I can do that?
|
|
|
|
|
I will like to believe u probably need to do some things before removing the page.
Try implementing these 2 mtds:
void CMyPropertySheet::RemovePage(CPropertyPage *pPage)
{
//do ur stuff...
//......
//finally, call the parent mtd...
CPropertySheet::RemovePage(pPage);
}
void CMyPropertySheet::RemovePage(int nPage )
{
//do ur stuff...
//......
//finally, call the parent mtd...
CPropertySheet::RemovePage(nPage );
}
Goodluck!
What would life be without programmers and salesmen?
|
|
|
|
|
Thanks for the reply!
I've done the same but the problem is that it throws an exception, I think it's due to another code I've put in the caller method.
|
|
|
|
|
I have 3 classes that are derived from each other as:
class A
class B: public Class A
class C: public class B
I've used a dynamic message in class A which resizes the controls on it. I want to resize the controls on classes B and C as well and I've put
BEGIN_DYNAMIC_MAP()
...
END_DYNAMIC_MAP()
on them but the controls are not resized in classes B and C.
Could you help me?
|
|
|
|
|
I don't know about..
BEGIN_DYNAMIC_MAP()
...
END_DYNAMIC_MAP()
I think it should be similar to BEGIN/END_MESSAGE_MAP. I'll also assume ur classes (i.e A,B,C) can recieve messages.
MFC docs says " if a message can't be matched in a derived class's message map, the framework also searches the message map of its immediate base class".
So check to ensure u have something like these...
//for class B
BEGIN_MESSAGE_MAP(B, A)
//..
END_MESSAGE_MAP
//for class C
BEGIN_MESSAGE_MAP(C, B)
//..
END_MESSAGE_MAP
search MFC doc for more details
goodluck!
What would life be without programmers and salesmen?
|
|
|
|
|
yes BEGIN/END _DYNAMIC_MAP()is something like BEGIN/END_MESSAGE_MAP that has been defined in a class that my A class is derived from that.
By the way, I do have
//for class B
BEGIN_MESSAGE_MAP(B, A)
//..
END_MESSAGE_MAP
//for class C
BEGIN_MESSAGE_MAP(C, B)
//..
END_MESSAGE_MAP
but nothing happens when resizing the classes B and C, and I couldn't find anything useful in MFC docs except what you have mentioned
|
|
|
|
|
You can try calling a virtual mtd (e.g doresize) from ur class A message handler. Remember to implement the mtd in B and C.
OR..
If class A is a CWnd kind-of (which I feel it is), then implement the usaul MFC's overidables like 'OnSize' e.t.c.
good luck!
What would life be without programmers and salesmen?
|
|
|
|
|
I've implmented OnSize() in child classes and the page itself is resized but the controls are not
I'm using this code to resize the controls and it works in the parent class:
BEGIN_DYNAMIC_MAP(CPropPageTabular,CPropPageItemize)
DYNAMIC_MAP_ENTRY(IDC_STATIC_REP_OPTIONS, mdResize, mdResize)
...
END_DYNAMIC_MAP()
|
|
|
|
|
Can I see the details of ur OnSize implementation?
What would life be without programmers and salesmen?
|
|
|
|
|
hello
i want to get the information about nbtstat command which is used in dos mode i want to get all information given
Z:\>nbtstat -a 192.168.1.215
Local Area Connection:
Node IpAddress: [192.168.1.216] Scope Id: []
NetBIOS Remote Machine Name Table
Name Type Status
---------------------------------------------
RES1_15 <00> UNIQUE Registered
BIIT-1 <00> GROUP Registered
RES1_15 <03> UNIQUE Registered
RES1_15 <20> UNIQUE Registered
BIIT-1 <1E> GROUP Registered
MIT01F-AFAZIL <03> UNIQUE Registered
MAC Address = 00-80-C8-F5-73-C1
using the vc++ or the api calls or mfc functions can u tell me plz how will i get this in vc i want to get actually the user name by giveing the ip address of the computer on the network while sitting on my own system .
tell me how will i do this work give me code related help too
regards
farrukh
du_aa
|
|
|
|
|
I think you need the Netbios system call, passing NCBASTAT as the ncb_command member of the NCB structure.
|
|
|
|
|
it works only for the adapter information i want to get the information like user name which i have told in the example
how will this information can i get plz tell me
regards
du_aa
|
|
|
|
|
plz give the idea by some coding help and getting the user name NCBASTAT gives the adapter satus i want the user name which the nbtstat gives like in example "afzal" is given by the nbtstat command
plzz tell me \
regards
du_aa
|
|
|
|
|
Hi.
There is my db in a romoted computer by ODBC Data source (DSN is "Manual access").
Computer's ip is 111.222.333.444, id is "ckc", pwd is "aaa".
My code is below.
CDatabase *pDBConnect = new CDatabase();
pDBConnect->Open( ---------------); <- I don't know this.
Please, tell me the answer.
I am looking forward.
|
|
|
|
|
Good time of day.
I need to get index of recordset from my database, but do not know how to do it. If anyone can help me, please, leave your answer here.
Thanks in advance, bilas
mailt:keeper_@km.ru
|
|
|
|
|
You did not indicate whether you were using MFC or not, but if so, CDaoRecordset::GetCurrentIndex() and CDaoRecordset::GetAbsolutePosition() come to mind.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I want to have a recordset with bi-directional scrolling,
but when I connected to my database like following:
>CString strConnection=_T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=module.mdb");
>if(m_db.Open(strConnection))
>{
> m_rec=CADORecordset(&m_db);
> if(m_rec.Open(_T("main"), CADORecordset::openTable))
> MessageBox("Table 'main' is opened ");
>}
following operation:
>m_rec.MoveFirst();
has no effect(does not works).
But using class CRecordset it works:
>m_rec.Open("SELECT * FROM main", CRecordset::dynaset);
What a mistake I made using CADORecordset?
Thanks in advance,
bilas.
mailto:: keeper_@km.ru
|
|
|
|
|
I write one multithread program to download file using CAsyncSocket. I got one problem. Can anyone help me out?
I derive my thread class from CWinThread. In thread class
I new one CAsyncSocket instance. and create and connect it
when It is one thread, it can work normally.when it is 2 threads
it can work normally at most. but when thread numbers is large,
they will cause exception. at the same time,for per thread, when socket OnConnect arise, it return WSAEADDRINUSE error.
I found another problem. when I debug 2 thread. during socket
Create call. the socket in the first thread can create normal,
but the socket in the second thread, It will cause assert .
It means the the m_hSocket has been in socket map.
I didn't know why this happen. I think socket map should be
thread local.
thanks
|
|
|
|
|
I have read this article before. But I didn't want to pass handle between
thread, I generate one CAsyncSocket instance for per thread, and do owner
job in thread, I didn't detach,attach handle from one thread to another
I didn't know if it is possible.
|
|
|
|
|
CAsyncSocket is probaly not what you want to use with multiple threads, but you can use this class to connect multiple sockets (download multiple files) in ONE thread... it works nearly unblocking.
Well, with multi threaded networking (if you REALLY need it that hardcore) you might have to use the "naked" socket API... see http://www.ecst.csuchico.edu/~beej/guide/net/ ... or any other API that Microsoft provides (see MFC articles in Code Project).
Hope it helps, Moak
|
|
|
|
|
Can you explain why not using CAsyncSocket for per thread?
I cannot figure out
|
|
|
|
|
it was not designed for that purpose.
it serves as asynchronous networking class: unblocking network access with events when a operation (like connect/read/write) has finished. in theory you could use it in multiple threads, but as far as I remember Microsoft's implementation was not multi thread safe (you get an assert with some functions in a debug build if you still try).
Perhaps rethink your network strategy, perhaps you can go single threaded and use CAsynSocket within one thread context (simple application code). However, the class is not very perfect it has some problems with DNS lookups (they block).
|
|
|
|