|
What part is giving you trouble?
File Source (Async) Filter
CLSID = CLSID_AsyncReader
Category = CLSID_LegacyAmFilterCategory
File Source (URL) Filter
CLSID = CLSID_URLReader
Category = CLSID_LegacyAmFilterCategory
If you've added the file source filter then use its IFileSourceFilter interface's Load() method
to get the filter to load the file.
|
|
|
|
|
hi this is ramesh .
i am writing a small win32 appl..i am using hierarchical stucture of check boxes in it(Tree view)
the functionality i badly needed is if i select a root item the child checkboxes should also get selected. could u help me to solve this problem??
if u have any example applications could u send me??
my mail id is sramesh21@gmail.com .
thanks in advance.
regards,
ramesh s
ramesh s
|
|
|
|
|
ramesh_s21 wrote: how to select the all the child checkboxes when a root is selected/clicked
You would be getting an event on the click of the root item.
Then get the children of the root and set them as checked using SetCheck...
I do think that you would be able to iterate through the child check boxes when the user clicks on the root.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
1. Implement notifications (NM_CLICK, TVN_KEYDOWN) to be notified when the user changes a root node checkbox state.
2. Implement and manage the LPARAM of inserted TVITEMs in tree to can retrieve HTREEITEM from LPARAM.
3. Use TreeView_SortChildrenCB macro, called when you need to also check all child items; the compare function will return 0 and will just modify the item state. Callback sort function will receive the lParam1 and lParam2 and will locate the HTREEITEMs from these (see 2). Finally, you set the nodes' checked state for both.
|
|
|
|
|
thanks cristian amarie.
could u plz get me sample code for tree view control with check boxes,if u have any?
thanks in advance.
regards,
ramesh s
ramesh s
|
|
|
|
|
I don't have one now, but for sure there are a number in MSDN samples and Platform SDK (try the older ones if you can spot some copies - the newer MSDN/PSDK seems to be more .NET oriented than API oriented).
CP also may have tree view samples as well.
I remember a sample containing almost all common controls, showing messages, notifications etc. - I don't remember the name now, was something with the solar system's planets in a listview. Check in MSDN, it won't be too hard to locate it and contains almost all you need to know. And more.
|
|
|
|
|
Hi all,
I am trying to make a chat server and client, for which I am inheriting the MFC CAsyncSocket. But the class member called Connect() is not properly responding. It shuld return nonzero value when connection succeeds and 0 if fails.But, it always returns zero,even when the connection succeeds.If the server is not listening, then also connection succeeds, but GetSockName() gives IpAddress=0.0.0.0, not the one which we specify for connecting. If server is listening, then the Ip Address which GetSockName() gives is correct.
I even tried with GetLastError() but it always returns a value 10035 even if the server is listening or not.
Please help me by providing a way to identify whether connection is success or failure..
thanks in advance...
SYAMLAL
|
|
|
|
|
SyamlalS wrote: it always returns zero,even when the connection succeeds
It returns 0 means , connection is not succesful. How you know that it is succesful ?
SyamlalS wrote: If the server is not listening, then also connection succeeds,
How you are deciding it, as 0 return value is for failure.
SyamlalS wrote: but it always returns a value 10035 even if the server is listening or not.
error code 10035 can be read as "A non-blocking socket operation could not be completed immediately."
|
|
|
|
|
hi prasad,
sorry for the delay in sending this reply
It returns 0 means , connection is not succesful. How you know that it is succesful ?
the connection becomes successful when the server is listening( return value is 0 ), I can identify this, since the data send from server side(after connecting) reaches at client and vice versa.
How you are deciding it, as 0 return value is for failure.
Even if the server is not listening, it connects, I identified this since the OnConnect() which I have overrided gets invoked.
error code 10035 can be read as "A non-blocking socket operation could not be completed immediately."
That means the non blocking connection is possible, but it will take time
Am I right??
SYAMLAL
|
|
|
|
|
SyamlalS wrote: the connection becomes successful when the server is listening( return value is 0 ),
But as connect is returning 0, its failing.
SyamlalS wrote: Even if the server is not listening, it connects, I identified this since the OnConnect() which I have overrided gets invoked.
It will get called, for every connect called, but important thing is it should succeed. Which is not, in you case, I guess.
SyamlalS wrote: That means the non blocking connection is possible, but it will take time
No.
|
|
|
|
|
status= connect(this->m_Socket,(sockaddr *)m_TargetSystem,sizeof m_TargetSystem));
if(status==SOCKET_ERROR)
{
int Error= this->GetPrevError();
}
else
{
// Your socket got connected...
}
haribabu
(impossible to understand)
|
|
|
|
|
if (!MyAsyncSocket.Connect(...))
{
int SockError = GetLastError();
if (SockError == WSAEWOULDBLOCK)
{
}
else
{
}
}
Call GetSockName() in OnConnect() if successful. Since you are getting WSAEWOULDBLOCK error
then the socket is not yet connected right after the call to Connect().
|
|
|
|
|
Hi All,
OpenFileMapping Fails with GetLastError() error code 2, i.e. ERROR_FILE_NOT_FOUND .
The problem is not frequent. It only occurs after few days of product being in production...Any help on this will be highly appreciated.
Thanks
Suraj Gupta
|
|
|
|
|
Gupta Suraj wrote: Fails with GetLastError() error code 2, i.e. ERROR_FILE_NOT_FOUND.
Problem may not be with this function. As error suggests , its not getting mapping object. Which may not be created in first place.
Like , CreateFileMapping may have failed already.
|
|
|
|
|
Thanks for reply!
Yes, this could be one of the possibilities. I m working in that direction. Their is another direction to this, i.e. Can the error returned by OpenFileMapping can be misleading?
Suraj Gupta
|
|
|
|
|
Gupta Suraj wrote: .e. Can the error returned by OpenFileMapping can be misleading?
Very unlikely. This API is there for such a long period. Could have caught any such failure already(and fixed).
In short, very unlikely.
|
|
|
|
|
Hi,
I hv made an application using win32, heavy graphics r involved in my project...im facing difficulty displaying the dialog box n msg box..since it is not getin displayed on the leftmouse event at the first time..i-e i want that when i click the leftmouse button at some specific event a dialogbox shud appear...but when i click the mouse button dialogbox aint getin appeared as it goes at the back of my application..may b coz os aint givin it the control, n i hv to go to taskmanager n enable the dialogbox....so if some1 can find a cure for for this ill b extremely thankful....or tel me an alterante to get the user input..
Thnx
|
|
|
|
|
Can you show code ?
ooolz wrote: ...but when i click the mouse button dialogbox aint getin appeared as it goes at the back of my application
Does SetWindowPos help ?
|
|
|
|
|
the code is too large to b attached
|
|
|
|
|
What about my second question ?
You can atleast show how you are invoking dialog box.
|
|
|
|
|
I'm sorry about my mistake 2days ago... cause that is the first time I race on this site. At firts, thanks for replying to my topic.
And now, I introduce about what I've done...
#include
#include
class cspell{
char* mean;// word's meaning
char* warray[12];//warray which is an array include words
public:
void init();//initializing
void check(char*);// check spell
void set(char* m);//add a word to dictionary database
};
I have built this class. And I have met some errors while I setup 3 behaviours(init , check, set).
I want to initialize warray's member... but I can't.
And this...
void check(char* word){
for( int i = 0; i if (strcmp(warray[i], word)==0) {
cout << word;
cout << "Good word.\n";
}
};
And I want to build word's meaning... But I don't know the method...
Do you know about my idea?...
I want to compare a word and a member of warray. But an error appeared.
"Set" behaviour is so hard... Please help me to built this class and its behaviours... Thanks for reading and replying.
My mind is too bad... I have learn this language 2 months ago by myself.
Try to find how to die
|
|
|
|
|
I'm not sure you asked about dictionary but I think we have article about dictionary on codeproject and also use of Ingnore html when want to send a code
|
|
|
|
|
It seems that <valarray> is incompatible with the MFC,
by searching the google I found it may work to #undefine
min(), max(). Is there any alternative to solve this problem?
Thanks!
|
|
|
|
|
ytod wrote: '06
It seems that <valarray> is incompatible with the MFC
What do you mean by incompatible ? Do you get any errors ?
ytod wrote: Is there any alternative to solve this problem?
If you are getting compilation errors, make include statement for valarray as first statement in stdafx.h .
|
|
|
|
|
I'm finding templates a bit hard to understand. I do understand some simple ones, but not everything. I looked at a sample program that finds max of two numbers and returns the bigger number. People say templates are generic but why not it take std::string into the function that finds of Max of two types(now it takes only numbers) We know that it's not sane to try "<" between strings but how does the compiler find the passed values are strings and reject it? and btw, how an STL container gets in anything we push? may it be numbers or strings, for example a vector. Can someone make a simple template program that just "holds" Object of any type, I just want to break the template barrier.
<br />
Box <int> box_int; box_int.hold(1);<br />
Box <std::string> box_str; box_str.hold("Astricks");<br />
Box <myClass> box_obj; box_obj.hold(myObj);<br />
Any help? Plz note: It's not a homework or assignement.
|
|
|
|