|
According to the documentation[^] alignment affects both header and content. The only way I can think to work round this would be to make it owner drawn and catch the WM_DRAWITEM message[^] to draw the items yourself.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
That first link looks like it is the answer to your question, give it a try and then modify to your specific requirements.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thanks a lot. That worked. It aligned the text as I expected but few items could not be drawn, I guess I have to skip where the item type is image instead of text. Or may be I have to set the image also. I am working on it. I had used lvs_ownerdrawfixed.
Thanks,
Rahul Kulshreshtha
|
|
|
|
|
In general the items in a list control consist of a text description and an image. If you use images then you would normally have one for every item. Take a look at Windows explorer and switch between the various views to see how the 'standard' displays are laid out.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi, its been a while since I've used CodeProject.
Quick Question.
I'm training myself on standard algorithms and trying to create a linked list.
In Java it's easy.
class Node{
public int data;
public Node next;
public Node(int val){ data= val; next = null;}
}
In the C++ Pre Ox11 you could use raw pointers.
struct Node{
int data;
Node* next;
Node(int val):data(val),next(0){}
}
but you had to new up your next node and delete it afterwards.
With the new version of C++, you can use unique_ptr.
But if I try to use that, I can't seem to get a good node to next.
struct node{
int data;
unique_ptr<node> next;
node(int al):data(val),next(nullptr){}
}
node a(3);
node b(4);
a.next = b; a.next = move(b); a.next.reset (b);
Please could you enlighten me, on how I can get this to work.
Many Thanks
Tom
|
|
|
|
|
Hm... Try it :
node a(3); a.next = new node(4); a.next->next = new node(5); a.next = move(a.next->next); unique_ptr<node> temp = move(a.next->next);
a.next = move(temp);
PS: any pre 0x11 C++ strcture or class may have a destructor as well :
struct node {
int m_iData;
node* m_pNext;
node(int iData) : m_iData(iData), m_pNext(NULL) {}
~node() { delete m_pNext; }
node* detach() { node* prevNext(m_pNext); m_pNext = NULL; return prevNext; }
} a(3);
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
modified 19-Nov-12 17:07pm.
|
|
|
|
|
I'm just guessing but the statement
a.next = b; looks like it should generate some kind of type mismatch error. At the very least I think you would have to deliberately cast 'b' to something before you can assign it to a unique_ptr variable. I'm not sure about the other two errors.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
write a XOR using the c programming language.
This program must accept as input from the user a value between 0 and 255 to be used as the
secret key, the name of the input file and the name of the output file. No line in the input file
should contain more than 4096 characters.
After the user would have provided their secret key, this program should read and perform an
XOR cipher on the contents of the input file and write the result to the output file.
If the input file has already been encrypted and the identical secret key that was used to
perform the initial encryption is provided, then the contents of the output file should be
deciphered into its original plain text.
can you please provide me with the algorithm on how to go about doing this work.
|
|
|
|
|
This is a fairly obvious homework question so you should at least make an effort to do the work yourself. If you do not understand how to apply XOR to a string of characters then you should read this page[^]. Similarly, reading and writing files is a basic part of the language that can be learned by reading these pages[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
thandy mitchell wrote: can you please provide me with the algorithm on how to go about doing this work
The algorithm is already provided by your requirements.
Veni, vidi, vici.
|
|
|
|
|
hi,
i want to know how to access some part of data in excel sheet and copy to text file using pure c++.....please send me a code if u know this.....
|
|
|
|
|
I have code that do that, but is in MFC, is good for you ?
|
|
|
|
|
Here at CodeProject we have an article on such topic: "Accessing Excel Spreadsheets via C++"[^]. It uses ATL and COM , I don't know if you include those libraries into the 'pure C++ world'.
Veni, vidi, vici.
|
|
|
|
|
You may use different methods to read Excel files. Which one to use depends on the version of the Excel files (XLS and/or XLSX) and if Excel is installed or not:
- Using
Excel Automation (COM / OLE Dispatch) with the Excel type library. This requires an installed Excel on the machine running your application (which defines what Excel file versions can be read) and the Excel type library on the development machine. - Using
ODBC or ADO (OLE DB ). These are database interfaces that handle sheets from Excel files like databases tables. Drivers for XLS files are present on all Windows systems. Drivers for XLSX files are installed by Office 2007 or with the 'Microsoft Access Database Engine 2010 Redistributable' package. - Using a library. Examples are the ExcelFormat Library[^] here at CodeProject and the commercial LibXL[^] library.
Once you have decided which method you want to use, search for samples here at CP and in the web using the above keywords. But be prepared that reading Excel files is not done with a few lines of codes.
|
|
|
|
|
Dear coders, for few days, I struggle to solve a simple problem: to scroll the window after zooming, in such a way, that mouse position stay in the exactly same logical position ... and I didn't succeded.
The view is based on CScrollView, mapping mode is always MM_TEXT, zomming is changing by 10%. Nothing special.
Have you see how Window Photo Viewer (from Windows 7) work on zooming ? I want to implement the same behaviour ... does anybody do that before ? Anybody have similar code ?
modified 19-Nov-12 4:19am.
|
|
|
|
|
|
Is it possible to write precommit hooks for svn in c/c++?
If so how to write a hook which will ask the user to update document version everytime the user checks in the document in svn. My knowledge is limited to the fact that the .exe to be created should be named Precommit and be placed in the repository where the user performs any action in repository.Please guide me.
|
|
|
|
|
SVN will automatically update the version when the document is checked in. It also provides a user API that you can interface with. See here[^] for further information.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hello Mukul,
I found this online source to be quite illuminating. Take a look at it. Hopefull you willl find it both helpful and beneficial.
"http://stackoverflow.com/questions/9773678/how-to-write-a-svn-hook-script"
Best of Luck,
Happy Reading,
With Kinds Regards,
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:38am.
|
|
|
|
|
I didn't find any useful code online for implementing the RealTime scheduler in c++. is there anyone can help provide ? Thanks advance!
|
|
|
|
|
|
Hi All,
Can you please tell me, what all the things i need to take care when i am trying to port my device driver 32 bit to windows 7 64 bit?
|
|
|
|
|
Googling with following phases seems to turn up results.
how to convert from 32bit to 64bit windows 7
gotchas converting from 32bit to 64bit windows 7
tutorial converting from 32bit to 64bit windows 7
converting 32bit to 64bit windows 7 site:codeproject.com
Last of those turned up the following (could be more.)
Lessons on development of 64-bit C/C++ applications[^]
|
|
|
|
|
...except this is a driver, not an app...
|
|
|
|