|
Hello Capallini,
i never use this method, maybe i should try this..
regards
break;
|
|
|
|
|
LPNMLVCUSTOMDRAW pLVCD = (LPNMLVCUSTOMDRAW)pNMHDR;
int nItem = (int) pLVCD->nmcd.dwItemSpec;
|
|
|
|
|
ups,
yes, you right, i use this before in my previous project, thanks... :->
regards
break;
|
|
|
|
|
Hi all,
I have a combo-box consisting of 30 elements.
I want the elements from 1-12 enabled , and the rest(13-30) disabled
and also once the user selects the disbaled items , the combo box should take care
of not selecting the options
How could I do this ..
Regards,
Veeresh
|
|
|
|
|
Veeresh Hiremath wrote: I have a combo-box consisting of 30 elements.
I want the elements from 1-12 enabled , and the rest(13-30) disabled
I doubt if this is possible. I don't think you could disable specific items in a CComboBox.
Veeresh Hiremath wrote: How could I do this ..
List only what is valid.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Veeresh Hiremath wrote: I want the elements from 1-12 enabled , and the rest(13-30) disabled
you have to subclass the CComboBox for same.. subclassing is the key to this type of effect
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
there's an article here on CP that does that.
here it is[^]
|
|
|
|
|
Hi all,
I have an application written in Visual C++6.0 which uses a Rich Edit Control to display user chat. I want to implement text highlighting as in MS Word for this rich edit control so that I can highlight messages from particular players.
I am using CHARFORMAT structure for formatting text. Can someone help me implementing this?
I tried using CHARFORMAT2 which has text BackColor property but it didnt help.
Thanking in anticipation
Sachin Bhave
|
|
|
|
|
CHARFORMAT2 cf;
memset(&cf, 0, sizeof(CHARFORMAT2));
cf.cbSize = sizeof(CHARFORMAT2);
cf.dwMask = CFM_BOLD;
cf.dwEffects = CFE_BOLD;
COLORREF clr =RGB(255, 10, 15) ;
cf.dwMask =CFM_COLOR;
//cf.dwEffects = CFE_AUTOCOLOR; // Bold
cf.crTextColor = clr;
|
|
|
|
|
Hello All,
I have small and simple COM program to access a Add function in Dll and I am accessing this function from main program. For the simple add function it is working, interface and dll files are working properly.
For this interface I am trying to add one more function by name getdate() which of return Char* .. can any one please help how to declare the getdate() function in interface ???
Below are declaration and files with there names ….
// File interface.h
// This file contains interface related declarations.
#ifndef _A_INTERFACE_H_
#define _A_INTERFACE_H_
DECLARE_INTERFACE_(IMyA,IUnknown)
{
STDMETHOD_(LONG,MyAdd)(INT,INT) PURE;
};
--- ---
--- ---
file :- MyA.h
class CMyA : public CCmdTarget
{
DECLARE_DYNCREATE(CMyA)
CMyA();
-- -- -- - - -- -- -- - -
-- -- -- - - -- -- -- - -
-- -- - -
-- -- - --- -- -- - --- -- -- - -
protected:
virtual ~CMyA();
DECLARE_MESSAGE_MAP()
BEGIN_INTERFACE_PART(MyAObj,IMyA)
STDMETHOD_(LONG,MyAdd) (INT,INT);
END_INTERFACE_PART(MyAObj)
DECLARE_INTERFACE_MAP()
DECLARE_OLECREATE(CMyA)
};
// MyA.cpp : implementation file
-- -- -- --- -- --
//IMyA Functions
STDMETHODIMP_ (LONG)
CMyA::XMyAObj::MyAdd (INT x,INT y)
{
return (x+y);
}
-------------------------------
// function to be added to Interface can u please help me how to declare this function in interface.
char* getDate()
{
struct tm *newtime;
char am_pm[] = "AM";
-- - - -
--- - -- - - -
}
Thanking you,
Suresh H
|
|
|
|
|
From the macros you're using I guess you implement the server using ATL.
Use the class wizard to add your new interface method: right click on the interface in the class view and select "Add method..." or something like that.
Hope this helps
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
Hi Roger,
Thanks a lot for the response.
I was waiting for a long time for the response thanks a lot.
Actually I did not use wizard for creating interface or for adding interface methods.
I manually written the code for the Add function and its working I can access the add
Function from the main function
Main function
int main (void)
{
IClassFactory *pclsf;
IUnknown *pUnk;
IMyA *pA;
int x,y;
long result;
//Initialize the OLE libraries
CoInitialize(NULL);
//get the IClassFactory interface pointer
HRESULT hr = CoGetClassObject(
MYA_CLSID,CLSCTX_INPROC,NULL,IID_IClassFactory,
(void **) &pclsf);
//USe IMyA interface for additions
printf("Input two numbers you want to add.\n");
scanf("%d\n%d",&x,&y);
result=pA->MyAdd(x,y);
The above function is working properly now I want to add one more function to interface
Which I have mentioned in the earlier post.
Can u please help me with that .. can u please tell me how to add function to interface
// file Interface.h
DECLARE_INTERFACE_(IMyA,IUnknown)
{
STDMETHOD_(LONG,MyAdd)(INT,INT) PURE;
}
no I want to add this function
har* CMyA::getDate()
{
struct tm *newtime;
char am_pm[] = "AM";
-- -- --
How to add this function to interface ?? please help me out …
|
|
|
|
|
As I see it there are two ways of implementing a COM server using ATL:
either you use the wizard provided help or you don't.
If you choose not to use the wizards, things get a little more hard but could be worth the trouble since you'll learn a lot from it.
In my opinion the best way to learn it is by actually doing it... i.e. in your situation create a dummy ATL project and make a backup of the files, then use the wizard to add an interface method and compare the files with the files in your backup copy.
Then you'll know what to do.
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
Hi Roger,
I am very much new to COM , I got an example in book I just went through it and created a working dll file .
There they have not used wizard for adding methods. I know how to add a new class for the project.
Can u please tell me how to add methods to interface using Wizards. ??
Thanking you..
Suresh H
|
|
|
|
|
Have a look at this article[^] in the CodeProject COM section. It describes how to create the project and add functionality to the server.
Have a look at other articles in the same section as well, CodeProject articles are a great starting point since people often tend to write about their own experiences. Try to find an article that meets your level of expertise/knowledge on the subject and startfrom there.
The article I suggested above looks suitable given how I interpreted your needs, but there might be another article that may help you better. Simply browse through the list of COM articles and judge from the heading to sort those out that you're interested in.
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
Hi Roger,
Thanks a lot for the help. LINK will help me a lot.
Regards,
Suresh H
|
|
|
|
|
Hello,
is it posible to make programs with VS6(C++) for multicore cpu?
Thanks in advance
break;
|
|
|
|
|
yes, but I would advise you to use the most up to date platform SDK.
|
|
|
|
|
Hello,
thank you for your reply, i have the newest version of platform SDK,
are there any settings in my projectsolution to take, or how to know that my application is for
multicore cpu created?
thanks!
break;
|
|
|
|
|
If your app is single-threaded, then you won't get any benefit from multiple CPUs or cores. If you do create other threads, let the OS schedule the threads across the CPUs as needed.
|
|
|
|
|
Hello Mike,
yes, ok, i like to know for the future how to use this in programming,
and my current app is multithreaded, maybe i can make this to multicore app...when i know more about multicore programming..
regards
break;
|
|
|
|
|
There's no such thing as "multicore programming" at application level. The operating system handles the details of multiple processors, multiple cores, hyperthreading, etc. If your application is multithreaded, the OS takes care of scheduling it on whatever execution units are available.
|
|
|
|
|
hi,
i have a editbox control in which i need to enter only alphabets if ne other characters are entered i have to display a message box in the button click.iwant the code for it.
can ne body help me out????????
thanx in advance,
zari
|
|
|
|
|
zareee wrote: i have a editbox control in which i need to enter only alphabets if ne other characters are entered i have to display a message box in the button click.iwant the code for it.
subclass edit control and override onKeyDown message
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
can u explain me more clearly
zari
|
|
|
|