|
hi
i am working on touch screen based application,I used edit box which have vertical scroll bar.I want to increase the width of vertical scroll bar of edit box.How is this possible
malik
|
|
|
|
|
Have you looked into the articles? I remember that there were some owner drawed controls with lots of extras. Maybe one of them has what you are looking for.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Hi,
My project does not contain any resources file , and I need to load an ICON from a specified location.
I used the following :
m_hIcon = AfxGetApp()->LoadIcon(_T"C:\test\res\OPTIONS_ICON.ico"));
but m_hIcon is allways NULL.
Anyone?
With best regards,
Eli
|
|
|
|
|
You need to escape backslashes inside strings, change
eli15021979 wrote: m_hIcon = AfxGetApp()->LoadIcon(_T"C:\test\res\OPTIONS_ICON.ico"));
into:
m_hIcon = AfxGetApp()->LoadIcon(_T"C:\\test\\res\\OPTIONS_ICON.ico"));
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks for your quick answer...
I tried this also , but m_hIcon still NULL.
Note that I'm able to load an ICON using a resources file
by AfxGetApp()->LoadIcon(IDI_NEW_LOGGER_ICON);
Thanks again,
Eli
|
|
|
|
|
eli15021979 wrote: AfxGetApp()->LoadIcon(_T"C:\test\res\OPTIONS_ICON.ico"));
will not work. U should use the LoadImage() function to load the icon from a file.
|
|
|
|
|
Did you try with LoadImage?
|
|
|
|
|
Hi all,
I encountered something that affects the embedded attachments in converting a MAPI to MIME message, I need my mimeheader to be multipart/related for the embedded attachments and multipart/mixed for the body and the regular attachments. At the ATL mime only multipart/mixed is available, Can anyone help me constructing a new boundary correctly and making the multipart/related header too.
thanks,
Jj
|
|
|
|
|
Hello all, I am developing one application, in that have created one report file with HTML tags. I am opening that in my application it self. If the report file is big then my application is displaying a message "Cannot create unique tag name,giving up". I did not understand this message. Can you please tell me how can i avoid this ?
|
|
|
|
|
How are you opening it ? What is throwing the error ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How did you try it and what was your code?
|
|
|
|
|
I have created a file which contains tables, text and a tree manner view also with HTML tags. No problem in opening this file if the file is small. If the file is big then my application is displaying a message "Cannot create unique tag name, giving up",
|
|
|
|
|
|
Hi everyone,
I came to the point where I would like to use virtual inheritance (don't ask why ). Although I have found several info on the web and I am pretty sure how I am going to use it, I have one problem left:
INCLUDE FILES.
All articles describe how to use virtual inheritance, but always in one file, something rarely useful in large projects. Everything I tried with #include files doesn't work. Here is my example:
-----------------------------------------------------------------------
// file Base.h
#ifndef BASE_H
#define BASE_H
class Base{
public:
Base();
virtual ~Base();
};
#include "Derive1.h"
#include "Derive2.h"
#endif
-----------------------------------------------------------------------
// file "Base.cpp"
#include "Base.h"
Base::Base(){}
Base::~Base(){}
-----------------------------------------------------------------------
// file Derive1.h
#ifndef DERIVE1_H
#define DERIVE1_H
#include "Base.h"
class Derive1 : public virtual Base{
public:
Derive1();
virtual ~Derive1();
};
#include "Join.h"
#endif
-----------------------------------------------------------------------
// file Derive1.cpp
#include "Derive1.h"
Derive1::Derive1(){}
Derive1::~Derive1(){}
-----------------------------------------------------------------------
// file Derive2.h
#ifndef DERIVE2_H
#define DERIVE2_H
#include "Base.h"
class Derive2 : public virtual Base{
public:
Derive2();
virtual ~Derive2();
};
#include "Join.h"
#endif
-----------------------------------------------------------------------
// file Derive2.cpp
#include "Derive2.h"
Derive2::Derive2(){}
Derive2::~Derive2(){}
-----------------------------------------------------------------------
// file Join.h
#ifndef JOIN_H
#define JOIN_H
#include "Derive1.h"
#include "Derive2.h"
class Join : public Derive1, public Derive2{
public:
Join();
virtual ~Join();
};
#endif
-----------------------------------------------------------------------
// file Join.cpp
#include "Join.h"
Join::Join(){}
Join::~Join(){}
-----------------------------------------------------------------------
// file main.cpp
#include "Base.h"
int main(){
Join test;
return 0;
}
-----------------------------------------------------------------------
This will not compile, probably because both Derive1.h and Derive2.h include Join.h. However, any combination I've tried didn't solve me the problem and the program still wont compile.
Any clues anyone?
Thanx,
Nik
|
|
|
|
|
First, please use the pre or code tags to format your code properly.
Now, for your question: you can remove all the includes that you put at the end of your files, you don't need them and they cause the problem. Include simply means that the compiler will replace the directive by 'pasting' the code from the included file. So, guess what happens if file1 includes file2 which in turn include file1 ? Yes, that's infinite recursion
|
|
|
|
|
Firstly, thanx for your answer.
True, but infinite recursion is avoided by the #ifndef directives. The reason I am putting them there is that I only want to include my Base class in the main program. If I remove them, then I have to include all the different files (Derive1, Derive2, Join).
In all other cases, this pattern works fine. But because in this case there is a "diamond" structure of inheritance (that's why I use virtual inheritance), this causes the problem here.
Is there any way to keep this pattern (I only want to include my "Base.h" file in "main.cpp") and still complile somehow?
|
|
|
|
|
What's the exact error message ? It's really difficult to guess what the problem might be just by looking at your source code (unformatted).
Nik1234 wrote: The reason I am putting them there is that I only want to include my Base class in the main program. If I remove them, then I have to include all the different files (Derive1, Derive2, Join).
Wrong: you just need to include Join.h because it already includes Derive1 and Derive2 and both of them include Base.h. And in general it is bad design to include the header files of the derived classes in the header of your base class (your base class should't be aware of its derived classes).
|
|
|
|
|
Actually you are right, it seems a bad design. True, in this case I would only need to include the Join class, but if I had 100 Join classes, I would need to include all of those...
So, I am changing my design by removing the include files at the end of the base class and creating another include file which will include my derived classes(the 100 Join classes ). By this way I will still include only one file and I will avoid the other conflicts
For your reference, the error I was getting was:
Derive1 class undefined
Derive2 class undefined
in the Join.h file.
Thanx a lot for your help!
|
|
|
|
|
How to set a region without its constructor?
With "new", it is less efficient.
OnMouseMove()
{
Region Rgn;
m_pic.GetRegion(&Rgn);
}
Take the advange of MakeEmpty and Union , it can be done. Not sure if there is a more efficient way.
|
|
|
|
|
followait wrote: Take the advange of MakeEmpty and Union, it can be done.
There's not any other options if you don't want to return
a Region created with new.
Moving the Rgn variable out of the OnMouseMove() function will
help by avoiding the constructor/destructor calls.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
My System is in a Network Domain.
I need to protect a File/Folder from getting copied by other users.I worked on Access
Control Entries and provided permissions to a folder so that it can be accessed programmatically only. If I Click on that folder it says Access Denied.
I have given List Folder contents permission and Traverse and Read Permissions and allowing access to only my user name.
Unfortunately I found that by right clicking on the folder->Security Tab-> Advanced-->owner tab
the user can Replace the owner and and can have full control to folder.
Is there any possibility for me to disable that option?
or else atleast can we remove the security tab option from properties for that specific folder.
I need an approach.
Any thoughts would be greatly appreciated.
Thanks
Satya
Today is a gift, that's why it is called the present.
|
|
|
|
|
//iam tring to show progressdialog on click ok button on Main dialog and update the WindowCaption in an interval of 1 sec. my problem described below..
HWND hWnd ;
void ProgressFunc(HWND hwnd , char* progress )
{
SetWindowText( hWnd , progress ) ;
<font color="green">
}
DWORD MyProgressDlgThread(LPVOID Nothing )
{
DialogBox(hInst,MAKEINTRESOURCE(IDD_PROGDLG1), ... ) ;
<font color="green">
return 0 ;
}
MyMainDialog_OkClick()
{
hWnd = NULL ;
char data[ 3 ] ;
HANDLE hTread = CreateThread( ... , (LPTHREAD_START_ROUTINE)MyProgressDlgThread , (LPVOID)NULL , ... ) ;
int i = 0 , n = 10 ;
while( i < n )
{
if( hWnd )
{
sprintf( data ,"%d" , i ) ;
ProgressFunc( hWnd , data ) ;
}
Sleep( 1000 ) ;
};
}
my problem is,
the dialogbox shown only after 2-3 seconds and the value is updated only once. how to
solve this problem ?
i cant use a timer here for some reason.
plz help me
Thanks & Regards
modified on Tuesday, December 11, 2007 2:18:28 AM
|
|
|
|
|
nitin3 wrote: int i = 0 , n = 0 ;
while( i < n )
{
if( hWnd )
{
sprintf( data ,"%d" , i ) ;
ProgressFunc( hWnd , data , 0 ) ;
}
Sleep( 1000 ) ;
}
you're code is somewhat confusing and seems incomplete. though I saw this:
int i = 0, n = 0;
while(i < n) //0 == 0 won't enter this loop
{
}
|
|
|
|
|
looks like you've modified your post.
nitin3 wrote: int i = 0 , n = 10 ;
while( i < n )
{
if( hWnd )
{
sprintf( data ,"%d" , i ) ;
ProgressFunc( hWnd , data ) ;
}
Sleep( 1000 ) ;
};
have you tried placing i++ inside your loop? it will be stuck inside that loop in the first place since you're not moving your counter. placing Sleep( 1000 ); inside the main thread will cause the dialog to be somewhat "stuck" because you are stopping the main thread of your application. I suggest you go for a timer or just place the process inside the thread you have created.
|
|
|
|
|
It is because messages are processed by your main thread. As your main thread is busy (you Sleep 3 times), no messages are processed during this time and your dialog is not updated. Once your function exits, messages are processed and your value is updated. It looks like only once but it is updated 3 times very fast.
You should do the opposite: keep your dialog in the main thread and put the 3 Sleep in the thread function.
|
|
|
|