|
Thanks for the shout out for that article. I wrote it after seeing one too many of these questions.
You've made my day by using for the intended purpose. "I don't have to give you an answer - go look at this!".
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: "I don't have to give you an answer - go look at this!".
|
|
|
|
|
|
|
1/ The article wasn't copied from that page!
My article was written 20th June 2007... The MSDN article says it was written on 30th July 2009.
2/ I found the information a little hard to gather initially...
3/ The original question you're in the thread of (how tangled is that!? ) answers your question of "why write this article". There were several related questions not long before I wrote it, and I could not see an appropriate resource on CP.
4/ I think my code is a little better wrapped up in a program than MSDN's.
5/ Maybe my other articles are more to your liking. I look forward to reading your more useful ones.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
I want to write data in xls file programaticaaly how ??
Trioum
|
|
|
|
|
I never used this[^] before but...can it be any help?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Using C++? #import the Excel type library (as shown here[^]), then use the Excel object model to do whatever you want.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
Is there any way to store the output of CreateProcess("C:\\Windows\\System32\\cmd.exe", command, NULL, NULL, 0, 0, NULL, NULL, &si, &pi); .so that it can be stored in an array.Basically i want to say that if in command i put /K dir then it will show all the directories but i want to store that name of directories or whatever which is output in an array. Is it possible?
|
|
|
|
|
ravi 12 wrote: .Basically i want to say that if in command i put /K dir then it will show all the directories but i want to store that name of directories or whatever which is output in an array.
You can actually get the list of files/folders in a folder using the FindFirstFile(), FindNextFile() functions. The method of using "dir" command to get the list of file doesn't seems good.
|
|
|
|
|
hey naveen,actually i want to see all the directories of all drives.can FindFirstFile() and FindNextFile() functions are able to show me the directories? can you please write down the source code?
|
|
|
|
|
ravi 12 wrote: hey naveen,actually i want to see all the directories of all drives.can FindFirstFile() and FindNextFile() functions are able to show me the directories
yes
ravi 12 wrote: can you please write down the source code?
Sorry. But there are lots of sample. Search google and code project for samples
|
|
|
|
|
ravi 12 wrote: i want to store that name of directories or whatever which is output in an array
So that's what all these threads about launching a new console with CreateProcess, running "dir", and redirecting the output were about?
I believe David Crow was the one with the best mind reading abilities right from the beginning when he suggested (twice) FindFirstFile()/FindNextFile() but you simply ignored that.
Since you're ignoring all suggestions - we can't help you.
|
|
|
|
|
hay Michael Schubert, actually at that time i didn't know anything about FindFirstFile() and FindNextFile() function() .so i was ignoring all those suggestions.
|
|
|
|
|
ravi 12 wrote: so i was ignoring all those suggestions.
Please note: people here make suggestions to try and help you, not for fun. Don't just ignore them and keep repeating your question, but give them a try. Read the documentation on MSDN, use Google to search for help, try the tutorials here on Code Project. Above all try and learn for yourself how to use the many tools that are available to solve your problems.
|
|
|
|
|
Hey Richard MacCutchan, sorry if my words "So i was ignoring all those suggestions" hurt you.Actually at that time i didn't know anything about the function FindFirstFile().I'm sorry for that.Don't mind these words.
|
|
|
|
|
ravi 12 wrote: sorry if my words "So i was ignoring all those suggestions" hurt you.
Ravi, don't worry, your words had no effect on me. I was merely trying to get you to see that when people here make a suggestion, then you should investigate it. It is made to help you get your job done.
|
|
|
|
|
Hi,
I have a Utility, written many years ago. It's main interface consists of a Dialog box with some Text, and Bitmap features. It worked without fault from Win98 upto XP. However, under VISTA, the Bitmaps display at about 2/3 of their design size.Anybody Any Idea why ?
Regards,
Bram van Kampen
|
|
|
|
|
Is the image placed on a static control using the SS_CENTERIMAGE style? The style used to fill uncovered areas of the control with the colour of the top left pixel in the image (a very nice feature btw) but that got changed in windows vista. The docs[^] say it got changed in XP but my apps still run the old behavior in XP but not in vista.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks,
No, this styleflag was not set.
It appears in general that my underlying code works under Vista, but, the carefully crafted Dialog Layouts break down. For starters, Bitmaps display at 2/3rd of their size. Listbox Geometry seems to reduce by a similar factor, the List goes On. What has changed that worked perfectly since Win95. Why was there a need to change.
Regards,
Bram van Kampen
|
|
|
|
|
Hi,
I am developing a desktop application composed by the main exe and several modules (dll / plug-ins) .
The main modules has a dialog where a CMFCPropertyGridCtrl is used to edit a collection of name/values pair.
Also another dll has a wizard that make use of a property sheet where a CMFCPropertygridCtrl edits another collection of name/values pair.
The application works as expected if only one of these dialog is executed.
No matter what is the sequence, the second time the dialog is opened, the program asserts.
I can open the same dialog more times, and it do not asserts, it asserts only when the second kind of dialog is opened.
The dialog (both) asserts when the mouse pointer is passed over the CMFCPropertyGridCtrl Control, the stack traces from the TrackToolTip function inside the class.
I have tracked the problem to the creation of the tooltip window:
in CMFCPropertyGridCtrl::Init() the call to m_IPToolTip.Create(this) fails:
BOOL CMFCPropertyGridToolTipCtrl::Create(CWnd* pWndParent)
{
ASSERT_VALID(pWndParent);
m_pWndParent = pWndParent;
if (m_strClassName.IsEmpty())
{
m_strClassName = ::AfxRegisterWndClass(CS_SAVEBITS, ::LoadCursor(NULL, IDC_ARROW), (HBRUSH)(COLOR_BTNFACE + 1));
}
return CreateEx(0, m_strClassName, _T(""), WS_POPUP, 0, 0, 0, 0, pWndParent->GetSafeHwnd(), (HMENU) NULL);
}
The first time this function executes, the CreateEx return TRUE and all works as expected.
The second time, only if from a different module (DLL or EXE), m_strClassName is not empty and CreateEx fails with error code 0x00057f e.g. "Warning: Window creation failed: GetLastError returns 0x0000057F" that is ERROR_CANNOT_FIND_WND_CLASS.
I do not use any tooltip, so I could also disable the tooltip feature.
(stack trace of the assertion, when the mouse passes over the grid (WM_MOVE) )
mfc90ud.dll!CWnd::GetWindowRect(tagRECT * lpRect=0x0012f06c) Riga 116 + 0x2a byte C++
mfc90ud.dll!CMFCPropertyGridCtrl::TrackToolTip(CPoint point={...}) Riga 3321 C++
mfc90ud.dll!CMFCPropertyGridCtrl::PreTranslateMessage(tagMSG * pMsg=0x00154e10) Riga 3937 C++
> mfc90ud.dll!CWnd::WalkPreTranslateTree(HWND__ * hWndStop=0x003e0662, tagMSG * pMsg=0x00154e10) Riga 2946 + 0x14 byte C++
mfc90ud.dll!AfxInternalPreTranslateMessage(tagMSG * pMsg=0x00154e10) Riga 233 + 0x12 byte C++
did someone experienced something similar? Am I missing something?
Thank you in advance.
Regards
ing. Federico Fuga
|
|
|
|
|
You do not need to perform the check -
if (m_strClassName.IsEmpty())
AfxRegisterWndClass[^] will only register similar classes once.
Read the remarks section of the documentation.
Here is an excerpt from the documentation -
If you call AfxRegisterWndClass multiple times with identical parameters, it only registers a class on the first call. Subsequent calls to AfxRegisterWndClass with identical parameters simply return the already-registered classname.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)
|
|
|
|
|
«_Superman_» wrote: You do not need to perform the check -
if (m_strClassName.IsEmpty())
Hi _Superman_, thank you for your response.
Yes, I know that check is useless, but it's not my code: as you can see, it's the source code of the CMFCPropertyGridCtrl class, in the Visual Studio 2008 MFC Feature Pack.
I should try to remove that check -- m_strClassName is a static member, so it's shared between DLL and EXE; maybe the registration of the control depends on the hInstance of the module calling the Create() function, so it's failing on the second call because it has been registered from another instance.
But this requires to recompile all the MFC / feature pack...?
Note that calling Create() from a third DLL do not solve the issue.
Thank you again
|
|
|
|
|
No No No....
Please do not compile the MFC code.
I didn't realize it was in the MFC code base.
MFC code is properly tested.
The problem could be else where.
Are you able to debug and reach the problem?
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)
|
|
|
|
|
No problem, I wasn't thinking that recompiling the MFC would solve the issue
The good news is that I have built a setup package using inno setup, and when installing on a plain Windows XP HE box the latest x86redist package downloaded from microsoft, the application works correctly.
The bad news is that I do not know why. The "working" mfc package has version number 9.0.30729.1, the package installed on my development box (and crashing) has the 9.0.30729.4148. This one seems to be an updated version, dated july 2009 (the working one is dated 2008).
I frankly expected that the older one was on my development box...
So the question is: the most updated library do not work because something has been broken in the library itself, or did I made some mistake on my application?
Any comment?
Thank you again
Federico
|
|
|
|