|
Behold, this years winner in the 'stupidest man of the year contest'.
Yeah, it's legal, just send your details to piracy@microsoft.com and they will fix you up.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
I am attempting to programmatically create a copy of a shortcut using the IShelllink interface. When I interogate most *.lnk files, the GetPath function returns a true target ie. "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe". There are some special shortcuts however, that behave differently. For example, a shortcut to MS Word returns the
C:\windows\installer\{ some guid }\wordicon.exe. from the GetPath function.
How can I determine the true target (ie: winword.exe ) given the information from the IShelllink functions?
Any suggestions?
|
|
|
|
|
from http://www.codeproject.com/editctrl/dropedit.asp[^]
CString ExpandShortcut(CString &inFile)
{
CString outFile = "";
ASSERT(inFile != _T(""));
IShellLink* psl;
HRESULT hres;
LPTSTR lpsz = inFile.GetBuffer(MAX_PATH);
hres = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
IID_IShellLink, (LPVOID*) &psl);
if (SUCCEEDED(hres))
{
IPersistFile* ppf;
hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*) &ppf);
if (SUCCEEDED(hres))
{
WORD wsz[MAX_PATH];
::MultiByteToWideChar(CP_ACP, 0, lpsz, -1, wsz, MAX_PATH);
hres = ppf->Load(wsz, STGM_READ);
if (SUCCEEDED(hres)) {
WIN32_FIND_DATA wfd;
HRESULT hres = psl->GetPath(outFile.GetBuffer(MAX_PATH),
MAX_PATH,
&wfd,
SLGP_UNCPRIORITY);
outFile.ReleaseBuffer();
}
ppf->Release();
}
psl->Release();
}
inFile.ReleaseBuffer();
return outFile;
}
A | B - it's not a choice.
|
|
|
|
|
We actually do just what is described above. We are interogating the Microsoft Word.lnk file ( the shortcut installed in the Documents and Settings\AllUsers.Windows\StartMenu\Programs\Office\Microsoft Word.lnk). The problem is, the IShellLink->GetPath function returns C:\windows\installer\{ GUID }\wordicon.exe . But we all know that when a user runs Microsoft Word, the process running is called winword.exe. How does the system launch winword.exe when the shortcut target is wordicon.exe ?
|
|
|
|
|
We actually do just what is described above. We are interogating the Microsoft Word.lnk file ( the shortcut installed in the Documents and Settings\AllUsers.Windows\StartMenu\Programs\Office\Microsoft Word.lnk). The problem is, the IShellLink->GetPath function returns C:\windows\installer\{ GUID }\wordicon.exe . But we all know that when a user runs Microsoft Word, the process running is called winword.exe. How does the system launch winword.exe when the shortcut target is wordicon.exe ?
|
|
|
|
|
hi,
how do you make the header, in report mode(list control), not clickable?
thx in advance!
|
|
|
|
|
Add the LVS_NOSORTHEADER style to the list.
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
What is the best and/or the most reliable method of testing of a LAN is connected to the Internet.
The Wininet APIs make it easy to tell if the user is connected to a dialup modem, and a LAN, but there is no direct way to tell if the LAN is connected to the Internet.
Sending an IMCP packet is not a possibility, other than that I am open to your suggestions.
Thanks
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Paul Watt wrote:
What is the best and/or the most reliable method of testing of a LAN is connected to the Internet.
To try to connect to a (few) known high-uptime site(s)?
|
|
|
|
|
I want to give color red for status = "Late", and blue for status = "Assigned" for each row in a list control. I tried ON_NOTIFY as suggested by many programmers found from www.google.com. But I can't get it to work. Here is the ON_NOTIFY function:
BOOL CProjectSearchView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
NMHDR *p = (NMHDR*) lParam;
//take the default processing unless we set this to something else
if (p->code == NM_CUSTOMDRAW)
{
if (m_pSet->m_STATUS == "LATE")
{
*pResult = CDRF_DODEFAULT;
NMLVCUSTOMDRAW* lvcd = (NMLVCUSTOMDRAW*)p;
if (CDDS_PREPAINT == lvcd->nmcd.dwDrawStage)
{
*pResult = CDRF_NOTIFYITEMDRAW;
}
else if (CDDS_ITEMPREPAINT == lvcd->nmcd.dwDrawStage)
{
//this is the prepaint stage for an item
COLORREF crText;
crText = RGB(255, 0, 0);
//store the color back in the NMLVCUSTOMDRAW struct
lvcd->clrText = crText;
//tell windows to paint the control itself
*pResult = CDRF_DODEFAULT;
}
}
}
return CRecordView::OnNotify(wParam, lParam, pResult);
}
-Elizabeth
Eilzabeth
|
|
|
|
|
Don't call the base class OnNotify() , it's wiping out the return value you store in pResult .
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I got it working now. I created a custom draw handler by following the tutorial in http://home.inreach.com/mdunn/code/LVCustomDraw/LVCustomDraw.html.
Handler
ON_NOTIFY(NM_CUSTOMDRAW, IDC_PROJECT_LIST, OnCustomdrawProjectList)
Prototype
afx_msg void OnCustomdrawProjectList(NMHDR* pNMHDR, LRESULT* pResult);
-Elizabeth
Eilzabeth
|
|
|
|
|
hi,
when i create a message box using afxmessagebox, can i get afxmessagebox to display the input string(the 1st parameter) in different font, size and color?
thx in advance!
|
|
|
|
|
Check out ClsMessageBox , part of Jan van den Baard's ClassLib[^].
---
Shog9
I see the way the salesmen stare into the sun
I stood and watched them as they fell off one by one...
|
|
|
|
|
NetServerGetInfo allows you to get the version information for a computer on a network, however, it doesn't seem to have a method for returning the suite information.
For example, both XP Home and Professional return the 5.1 as their version number, but unlike the GetVersionEx, NetServerGetInfo doesn't return a suite mask.
So, how do you differentiate between the two when getting their information over the network?
Jon Sagara
Hi! I'm Melanoma, Moley Russell's wart.
-- Uncle Buck
|
|
|
|
|
Huh? XP Home and XP Professional are different?
You can pick your friends, and you can pick your nose, but you can't pick your friend's nose.
|
|
|
|
|
Yes. XP Home doesn't have domain support, therefore, our product doesn't support it.
Jon Sagara
Hi! I'm Melanoma, Moley Russell's wart.
-- Uncle Buck
|
|
|
|
|
Jon Sagara wrote:
So, how do you differentiate between the two when getting their information over the network?
Jon, I don't think it's possible.
I don't have either about to test on, but I think you have found a genuine glitch.
I think that "Windows Server 2003" will probably identify itself differently. (I hope)
The only other way I guess is to test if something fails to run on the Home "Suite".
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining.
Said by Roger Wright about me.
|
|
|
|
|
Argh.
Oh well. Time for my morning cup of . Thanks for the response.
Jon Sagara
Hi! I'm Melanoma, Moley Russell's wart.
-- Uncle Buck
|
|
|
|
|
Isn't there some Wnet* function for this? Something like WnetGetInfoNnn?
|
|
|
|
|
Can we set two objects of a structure with two intrinsic data type members equal to each other and expect a member by member copy? Or do we do this explicitly?
Appreciate your help,
ns
|
|
|
|
|
I believe you need assignment operator or copy constructor. One solution is to implement the solution using classes, not structures.
Kuphryn
|
|
|
|
|
I'm not sure what the C++ standard says about it, but with Visual C++, you can expect the member by member copy, as long as you've got members that the compiler can generate code to copy (base types, other simple structures, or objects who's class allows copying).
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
In 'straight' C, assigning one struct to another is a simple binary copy:
struct S {
int A;
double B;
};
<br>
struct S V1;
struct S V2;
<br>
V1.A = 1;
V1.B = 2.3;
<br>
V2 = V1;
<br>
printf("V2.A = %d, V2.B = %lf\n",V2.A,V2.B) will print "V2.A = 1, v2.B = 2.3".
It works the same in C++, as long as there is no assignment operator defined for struct S . If there is an assignment operator defined, then the behavior depends upon the operator.
Software Zen: delete this;
|
|
|
|
|
I have a map being used as:
void CSVBoxView::MakePalettes()
{
m_Pal1 = "Remus";
m_Pal2 = "Q14";
CImage & ImageRemus = m_PaletteMap[m_Pal1];
CImage & ImageQ14 = m_PaletteMap[m_Pal2];
where
std::map is of type [CString, CImage] m_PaletteMap;
(I cant put the angled brackets around the map declare in CP)
On running it crashes at CImage & ImageRemus = m_PaletteMap[m_Pal1]; which is how a new empty image is created. It says unhandled exception, and in the debug window it says:
HEAP[SVBox.exe]: Invalid Address specified to RtlFreeHeap( 2f0000, 6c440088 )
I tried looking at the call stack but its stopped in NTDLL. What dumb thing have I done?
Appreciate your help,
ns
|
|
|
|