|
I have installed Visual Studio .NET on my PC and now I want to install it on my new one instead. Unfortunately, my disks are in the server room on another site and I can not get to them. Can anyone tell me how to get the license key from Visual Studio? My disks are available on a server which I can connect to of course, but I can not get to the physical disks which have the key!
|
|
|
|
|
I believe that you can get the key from the Help->About menu from the first installation.
Artificial intelligence is no match for natural
stupidity.
|
|
|
|
|
I looked at that, but there are not enough numbers - and they are in the wrong format:
20 numbers:
nnnnn-nnn-nnnnnnn-nnnnn
I believe it should be in this format:
25 numbers/letters
nnnnn-nnnnn-nnnnn-nnnnn-nnnnn
|
|
|
|
|
I found out that a bitmap containing alpha channel can be specified to a layered window in order to obtain a special defined map alpha, not just a general level of transparence.
This is done by using the UpdateLayeredWindow function.
This is all fine, but I still have some problems:
Since I provide the look for the window throught my bitmap, the window will look just like that! This means that any controls that I have on my frame are not drawed anymore. I also can't use this stuf for children controls (windows).
One solution I think of, is to draw all the children myself over the bitmap I use to set the window look. But what can I do with other controls that I don't want to draw myself (think of an Internet browser control - I can't draw that). Maybe is a way to force windows to draw on a specified hdc ?
If anyone can help, cause I really think it's a great feathure that I can't fully use !
Alex
xelanoimis@yahoo.com
|
|
|
|
|
Hi all,
I am getting problem while using this CRichEditCtrl::SetParaFormat .
I am writing what I am getting.
Step1- I have changed the para formatting by using this code
PARAFORMAT pf;<br />
pf.cbSize = sizeof(PARAFORMAT);<br />
pf.dwMask = PFM_ALIGNMENT;<br />
pf.wAlignment = PFA_LEFT;<br />
m_RE_Output.SetParaFormat(pf);
Step2- Then I have changed the para formatting by using this code
PARAFORMAT pf;<br />
pf.cbSize = sizeof(PARAFORMAT);<br />
pf.dwMask = PFM_ALIGNMENT;<br />
pf.wAlignment = PFA_RIGHT;<br />
m_RE_Output.SetParaFormat(pf);
in step2 the above performating goes out, I mean as soon as the step2 code being executed the above code also changes to the right side.
Please tell me, anything which i am missing, I mean any message I have to post to the RichEdit class to inform it that I have changed the para format.
I am very thankfull.
The Phantom.
|
|
|
|
|
Phantom,
When you do the second SetParaFormat, are you on a different paragraph? Each paragraph is seperated by a "\r\n".
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
Hello all
Is there anyway to read the office documents like reading a text files?
for eg, we use ifstream to access the text file.
I want to change the autodate ( for example, in word, if you want to insert the date that will change automatically every time you reopen the doc, you go to insert menu and click date and time to insert the date and time. ) in the docs
I want to replace every autodate with the const string like " THIS IS AUTO DATE"
Anyone ??? please
|
|
|
|
|
Hi,
I'm writing a small program with a basic text editor incorporated. It is basically a dialog box with a rich edit box and the capability of saving what is written in the rich edit box to a .txt file. Here is the function I am using to save the text (I'm using _no_ MFC, by the way):
[code]
void SaveRichEditText(HWND hWnd, int nIDDlgItem, char* szSaveFile)
{
char szText[100000]="";
GetDlgItemText(hWnd,nIDDlgItem,szText,100000);
HANDLE hFile = CreateFile(szSaveFile,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
DWORD dwW;
WriteFile(hFile,szText,strlen(szText),&dwW,NULL);
CloseHandle(hFile);
}
[/code]
This works fine, and the file is saved with the correct text.
However, as you can easily see from the code, this has a severe restriction: the text that can be saved is limited to 100,000 characters (or any other arbitrary limit I choose for char szText[]).
This is no doubt a very stupid and basic question, but I can't find the answer in my Sams or "C for Dummies" or other books, so please forgive the lack of knowledge of a relative novice:
How do I make it so that the text length is not limited by the char? Is there a way to get the length of the text in the Rich Edit box and then create a string on the fly that is the length of this? I am sure I have seen somewhere a method using mem... commands, but can't find the answer.
Once this is solved, I would then need to create a load command that reads the text from file using ReadFile(), and I will be faced with a similar problem - namely getting the length of the string from the .txt file and creating that string to insert into my rich edit box.
If anyone can tell me how to go about solving these two problems, I would be really grateful - apologies again if this is a really basic question.
Many thanks,
KB
|
|
|
|
|
try this:
void SaveRichEditText(HWND hWnd, int nIDDlgItem, char* szSaveFile)
{
// Counters
uint nCount = 0;
uint nNewCount = 0;
BOOL bRet = FALSE;
char* szText = new char[100000];
// Get the initial count returned
nNewCount = GetDlgItemText(hWnd,nIDDlgItem,szText,100000);
// Keep getting the count until it returns 0
while( nNewCount > 0 )
{
nCount += nNewCount;
nNewCount = GetDlgItemText(hWnd,nIDDlgItem,szText,100000);
}
// If there is nothing to save return or insert code to create the file and return.
if( 0 == nCount )
{
return;
}
// Delete the array.
delete[] szText;
// Create the array the necessary size (nCount + 1(NULL) )
szText = new char[++nCount];
// Get all of the data.
GetDlgItemText(hWnd,nIDDlgItem,szText,nCount);
// Create the file
HANDLE hFile = CreateFile(szSaveFile,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
DWORD dwW;
// Save the data.
bRet = WriteFile(hFile,szText,nCount,&dwW,NULL);
// Close the file
CloseHandle(hFile);
// Check for write error
if( TRUE != bRet )
{
// Handle Error
}
}
Its probably not the cleanest way of doing things, but it is never the less a way. Hope it helps.
|
|
|
|
|
I'll suggest you to use RichEdit messages,
EM_GETTEXTLENGTHEX to get length of text and create bufer. and EM_GETTEXTEX to get text and fill buffer
|
|
|
|
|
Great, thanks for the info, and thanks for the replies to both of you.
In the end I went the EM_GETTEXTLENGTHEX route and used that to create the buffer, though I had problems before realising that I needed to load RichEd20.dll instead of RichEd32.dll, and then, because I was using a dialog-based app, I had to manually change the class name in the .rc file to "RICHEDIT20A" instead of "RICHEDIT" (just in case anyone else encounters this problem).
Thanks again!
KB
|
|
|
|
|
You need to look for TVN_xxx notification messages.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
If your checkboxes are images then I think following code can help you
1) go to classwizard -> add the NM_CLICK message function to your treecontrol
<br />
<br />
OnClickSmptree(NMHDR* pNMHDR, LRESULT* pResult) <br />
{<br />
*pResult = 0;<br />
CPoint pt;<br />
::GetCursorPos(&pt); <br />
m_TreeCtrl.ScreenToClient(&pt);<br />
<br />
UINT nFlags;<br />
HTREEITEM hItem = m_TreeCtrl.HitTest(pt,&nFlags);<br />
<br />
if((nFlags &= TVHT_ONITEMSTATEICON))<br />
{<br />
<br />
}<br />
|
|
|
|
|
Can anybody tell me the meaning of: #define WM_GRAPHNOTIFY WM_USER+13.
Here WM_GRAPHNOTIFY is window message used in DirectX. But how this WM_USER + 13 value is set.
Even at one code, I have seen: #define WM_GRAPHNOTIFY WM_APP + 1.
Pls explain what is the purpose of these statements.
|
|
|
|
|
Read this from MSDN help:
Message numbers in the second range (WM_USER through 0x7FFF) can be defined and used by an application to send messages within a private window class. These values cannot be used to define messages that are meaningful throughout an application, because some predefined window classes already define values in this range. For example, predefined control classes such as BUTTON, EDIT, LISTBOX, and COMBOBOX may use these values. Messages in this range should not be sent to other applications unless the applications have been designed to exchange messages and to attach the same meaning to the message numbers.
That should answer your question. You can read further about the other message types on MSDN
|
|
|
|
|
I have CheckBox in TreeControl (from WTL). Please let me know how can i receive Event notification from checkbox when it is selected/unselected. I tried LButtonDOwm and OnClick but it does not work.
For LButtonDOwn i used
NOTIFY_HANDLER(IID_TC, WM_LBUTTONDOWN, OnLButtonDown) but control does not come to this.
For click i am unable to detect on which item was clicked.
NOTIFY_HANDLER(IID_TC, NM_CLICK, OnClick)
Thanks
Shiv
|
|
|
|
|
Hello,
I have a dialog based application and I have added another dialog box to the resources, made a class for it (derivated from CDialog).
I want to pop up one "new type dialog box" from the main window on action A and want it to remain there until I close it on action B. I can only close it from the (X) on the up right corner. The dialog style is pop up.
//on Action A
CNewtDlg x;
int nRet = x.DoModal();
//on Action B
// I tried 3 things to close the dialog one at each time.
// none of them works
x.EndDialog(nRet); // 1st try
x.EndDialog(0); // 2nd try
x.CloseNewDialog(); //3rd try
I also made a member function
CNewDialog::CloseNewDialog()
{
this->EndDialog(0);
}
I would be very happy if someone helped me solving this
Thank you
|
|
|
|
|
Call CDialog::OnOK() or CDialog::OnCancel();
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
caykahve wrote:
int nRet = x.DoModal();
Your dialog x is modal. That means your application waits for it to be closed to continue its work.
This way, your application encounters your tries to close the dialog x only after that has already been closed by the user.
You need to make x an non-modal dialog, and close it in the ActionB-handler.
The call to make your dialog non-modal is x.create(), but there is more to it. Please read the chapter in a good book (like the Prosise) and look examples up at CP.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
thank you
create , ShowWindow, and DestroyWindow made it work.
|
|
|
|
|
I've been tasked with looking at sorting some CDO code which runs in an NT service. It works fine from a console but when I run it as an NT service it fails when trying to log on to an Exchange 2000 server. The code uses CDO rather than Extended MAPI (which is what I would've used), and I'm tempted to rewrite it in MAPI, but it would potentially take a lot longer than just trying to fix the existing code. I know there were issues with CDO in an NT service for Exchange 4.0 and I've have found various suggestions that CDO from an NT service is definitely not recommended. Can anyone shed some light on this topic? I'm happy to rewrite using MAPI but I may need some sort of justification for the effort required.
Also, does anyone know of anny decent resources other than MSDN for CDO wrt source code, problems, bugs etc.
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|
|
The problem, I think, is that your NT service is running under a different account (typically LocalSystem) therefore cannot open the appropriate e-mail connection. What you can do is, reconfigure the NT service to run under the correct user account (the account that owns the e-mail profile, etc.).
You can also write your code as a regular program (not as a service) and start your program with XYNTService[^].
My articles and software tools
|
|
|
|
|
Hi , Ive classic List Control with some header stuff. Now i need to manually select row but i cant find any function such as "SelectItem" or similar or any other solution. Can anyone help me plz ? Thx in advance.
|
|
|
|
|
CListCtrl::GetNextItem(-1, LVNI_SELECTED);
This is for single selection only.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
ctrl.SetItemState(index, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|