荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: tang (独孤九剑), 信区: Program
标  题: MSVC-BEGINNERS Digest - 20 May 1998 to 21
发信站: BBS 荔园晨风站 (Mon May 25 18:13:36 1998), 转信

here are 8 messages totalling 295 lines in this issue.

Topics of the day:

  1. OnCtlColor
  2. Porting Problem (3)
  3. Grid control
  4. <No subject given>
  5. browse for folder
  6. Close All
On Fri, 15 May 1998, Charles R. Derk, Jr. wrote:




hey dear friends,

  To change the color of the disabled controls u have  compare with
        CTLCOLOR_STATIC
following code works properly


 HBRUSH CAd32CustView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
> {
>         HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
>
>         if (nCtlColor == CTLCOLOR_STATIC)
>         {
>                 pDC->SetTextColor(RGB(255, 255, 255));  // black
>         }
>         // TODO: Return a different brush if the default is not desired
>         return hbr;
> }
>
-klement


> VC5.0 (SP3), WinNT4.0(SP3)
>
> Hey all,
>
> I have a customer information screen that the user can only change data
> if they have the proper permissions, otherwise, the edit controls are
> grayed out.  The problem is, the gray text... I would like to change it
> to black.
>
> I am using the following code...
>
> HBRUSH CAd32CustView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
> {
>         HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
>
>         if (nCtlColor == CTLCOLOR_EDIT)
>         {
>                 pDC->SetTextColor(RGB(255, 255, 255));  // black
>         }
>         // TODO: Return a different brush if the default is not desired
>         return hbr;
> }
>
> The problem is that this code will only work on the controls that are
> not disabled.
>
> I am using the EnableWindow(FALSE) function to disable the controls on
> the form.
>
> Am I missing something, or can you not change the color of disabled
> controls?
>
> Thanks!
> -Charlie-
>
>
> ----------------------------
> Charles R. Derk, Jr.
> Software Developer, GraphX, Inc.
> http://www.adtaker.com
> Voice:(610) 797-5515 x131 Fax:(610)797-8740
>
Hi,

        I am working on a 16-bit(VC++ 1.5) to 32-bit(VC++ 4.0) conversion.
        While converting I've got a problem.

        I've replaced libraries that were used in the 16-bit
        with the 32-libraries.

        The compiler is not complaining any thing, but the linker
        is giving the following error.

        error LNK2001: unresolved external symbol symbol_name

        Can any one help me in solving the problem.

Regards
Sreedhar









*****************************************
*      Sreedhar  Badimela,
*      Wipro Systems, III Floor,
*      1-8-448, Begumpet,
*      Secunderabad,
*      ANDHRA PRADESH - INDIA
*      Ph: 866008 ext:4312
*      E-Mail : bsree@wiphyd.ge.com
******************************************
 Hi Sreedhar ,

    What do you mean by "symbol_name" ? Is it a fuction name ?

>         error LNK2001: unresolved external symbol symbol_name

    This error usually occurs when you forget to include library where
    the symbol_name presents. So please make sure whether you have
    included all libraries.

    Have a nice day ,

Sankar S.
Hi Sankar,

>     What do you mean by "symbol_name" ? Is it a fuction name ?

No, it is not a function name. It is a variable used in the library.

I have included all the required libraries. And infact i have also gone
thru
the help on the LNK2001. I wasn't able to extract anything helpful from it.

How do u proceed to remove such type of linker errors ??

Have a nice day ,
 Sreedhar
VC4.0, NT4.0

Hi Folks

I want to add a grid control to a dialog box. I registerd the grid
control with TSTCON32.exe & copied the grid32.ocx file to winnt/systems
directory. When i open the dialog box & try to insert the grid control
into the dialog, i get the following message box.

 "the ole control grid control could not be instanciated because it
requires a design time lisence"

Obviously some sort of lisence is required ( msdev of course is a legal
copy , by extrapolation (since the grid32.ocx was from the same disk) the
grid control should also be legal isnt it ?

So what do i need to do to get the nessasry lisence/setup.... ?
regards
Krishna
Hello, beginners!

I want to start programming again in C++. Some time ago I studied OOP
and C++ and did my first
programs in Borland C++ 3.1, for the DOS environment. Then I started
learning something about Window's programming, but I have to stop for
differents reasons. Now I'm getting in the road again and
I find a new bunch of compilers, environments, RAD, wizards, class
libraries an so on...  from different vendors, with this new age of
Visual programming!!!
Could someone give my an advise on what compiler and development
environment should I use?
I mean, I want to know your preferences and your arguments.

Thanks in advance for any comment.   8)

Sergio A. Yazyi
Analyst
sidyas@siderca.com
Env : MSVC 1.52 Win16 (running on Win95)


Hi,

When programming win32 apps there is a function available call SHBrowseForFolder
. I need exactly the same functionality in a Win16 app.

As far as I can see, there are a few different options :-

- Customize the file open common control.
- Program it almost from scratch probably based on a list box.
- Find something on the web.
- maybe get access to SHBrowseForFolder using 'Generic Thunking' or some such th
ing.

Any recommendations would be fab...

Phil.
Hi List,
        Some time back there was a question on how to close all child windows.
(Window/CloseAll implementation). Here is the solution.

void CMyApp::OnWindowCloseAll()
{
        // TODO: Add your command handler code here
        POSITION pos = GetFirstDocTemplatePosition() ;
        CDocTemplate *pTemplate ;
        CDocument *pDoc ;
        BOOL bSaved = FALSE ;
        while(pos !=NULL)
        {
                pTemplate = GetNextDocTemplate(pos) ;
                POSITION posDoc = pTemplate->GetFirstDocPosition() ;

                bSaved = FALSE ;
                while(posDoc !=NULL)
                {
                        pDoc = pTemplate->GetNextDoc(posDoc) ;
                        bSaved = pDoc->SaveModified() ; //Prompts the user wh
ether to save the
modified Document.
                }

                if (bSaved != 0) //Donot close if user clicks on cancel
                        pTemplate->CloseAllDocuments(FALSE) ;
        }
}

HTH,
Raghu, N.
--
        There are these few times I feel lonely for you.
        But I know this shade of blue will soon pass through!
        I must be strong without you by my side!
        I can see forever you are my light.

※ 来源:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: 192.168.0.4]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店