|
Hello
Can anyone give me a little short description of the different shortings in visual C++,
And maby give me an example of what they are?
ATL, CLR, GENERAL, SMART DEVICE, WIN 32 APPLICATION..
Thanks for answer
Regards
|
|
|
|
|
shortings ?
Where did this list come from ?
ATL is the Active Template Library, for COM
CLR is the .NET framework, C++/CLI apps
When the General talks, you better listen to him
A smart device is a device that is smart, such as a scientific calculator, or a handheld windows device.
Win32 is what all our apps really are, a Win32 app would be an app that doesn't use the CLR, or MFC, it uses the Win32 API directly.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: shortings ?
When you are longing for something, that means you really want it. When you are shorting for something, I guess that means you don't really want it.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi Christian
Thanks for the replay
The reason why i need this information is that i am a chiptuner, that program my own software for car,
and now im going to make software that communicate with the cars mcu..
The language it self is one thing im reading on at moment, but my problem is mostley to know when to use the different settings in visual studio.
The normal standard communication protocoll in car is KWP2000,
I have seen that, many of these communication interfaces that i have uses dll, but i guess i can start building a win32app, that can communicate through an usb-interface, to cars mcu?
Any suggestion where to start?
Regards
Frank
|
|
|
|
|
If you want an app running on your PC, which then talks to the car via some communication protocol, you may want to look at using MFC. However, even C# is probably OK on the PC side, the key thing is getting the software right on the car end, which will probably be in C.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
oki, so then i maby use the mfcapp or mfcdll?
REGARDS
Frank
|
|
|
|
|
If you want to write a windows application, then MFC is easier than Win32. A dll is not a program, it's a library. If you want a program that runs, you need to create an exe.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Oki
Thanks for youre help
Maby i need more help from you, or i can tune youre car
Regards Frank
|
|
|
|
|
*grin* thanks for the offer, but I suspect geography may get in the way of me taking it up...
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Hi,
I use a CListView as a virtual list in which I display a list of files and file information like size and type.
in the LVN_GETDISPINFO handler I add LVIF_DI_SETITEM to the item mask so that the control will not ask for the data twice for the same item, but it doesnt work at all! the control always asks for data whenever the displayed contents are changed.
I mask the LVIF_DI_SETITEM as follows:
pItem->mask|=LVIF_DI_SETITEM;
and my whole msg handler is as follows if u would like to have a look:
void CFileListView::OnGetdispinfo(NMHDR* pNMHDR, LRESULT* pResult) <br />
{<br />
LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;<br />
CProdigyExplorerView *pView=(CProdigyExplorerView*)GetParent();<br />
LV_ITEM* pItem= &(pDispInfo)->item;<br />
pItem->mask|=LVIF_DI_SETITEM ;<br />
int itemid = pItem->iItem;<br />
*pResult = 0;<br />
CFileFolderInfo *pFI;<br />
if(itemid > CFileFolderManager::m_Folders.GetUpperBound())<br />
pFI = (CFileFolderInfo *)CFileFolderManager::m_Files[itemid-CFileFolderManager::m_Folders.GetUpperBound()-1];<br />
else<br />
pFI=(CFileFolderInfo *)CFileFolderManager::m_Folders[itemid];<br />
if (pItem->mask & LVIF_TEXT)<br />
{<br />
if(pView->m_lstFiles.GetHeaderText(pItem->iSubItem)==_T("Filename"))<br />
{<br />
wcsncpy(pItem->pszText,pFI->m_Attributes.cFileName,pItem->cchTextMax);<br />
}<br />
else if(pView->m_lstFiles.GetHeaderText(pItem->iSubItem)==_T("Size"))<br />
{<br />
CString strSize = CFileFolderManager::FormatFileSize(pFI->m_Attributes.nFileSizeHigh,pFI->m_Attributes.nFileSizeLow,0);<br />
wcsncpy(pItem->pszText, (LPCTSTR)strSize,pItem->cchTextMax);<br />
}<br />
else if(pView->m_lstFiles.GetHeaderText(pItem->iSubItem)==_T("Type"))<br />
{<br />
<br />
}<br />
else if(pView->m_lstFiles.GetHeaderText(pItem->iSubItem)==_T("Created"))<br />
{<br />
CString strTime = CFileFolderManager::FormatFileTime(pFI->m_Attributes.ftCreationTime,FALSE);<br />
wcsncpy(pItem->pszText,(LPCTSTR)strTime,pItem->cchTextMax);<br />
}<br />
else if(pView->m_lstFiles.GetHeaderText(pItem->iSubItem)==_T("Modified"))<br />
{<br />
CString strTime = CFileFolderManager::FormatFileTime(pFI->m_Attributes.ftLastWriteTime,FALSE);<br />
wcsncpy(pItem->pszText,(LPCTSTR)strTime,pItem->cchTextMax);<br />
}<br />
else if(pView->m_lstFiles.GetHeaderText(pItem->iSubItem)==_T("Accessed"))<br />
{<br />
CString strTime = CFileFolderManager::FormatFileTime(pFI->m_Attributes.ftLastAccessTime,FALSE);<br />
wcsncpy(pItem->pszText,(LPCTSTR)strTime,pItem->cchTextMax);<br />
}<br />
}<br />
<br />
if( pItem->mask & LVIF_IMAGE) <br />
{<br />
<br />
if(pView->m_iLVStyle != LVS_ICON)<br />
{<br />
if(pFI->m_iSmallIconIndex!=-1)<br />
{<br />
pItem->iImage=pFI->m_iSmallIconIndex;<br />
return;<br />
}<br />
int iIconIndex;<br />
CString strExtension=CFileFolderManager::GetFileExtension((CString)pItem->pszText);<br />
if((iIconIndex=pView->GetTypeIconSmall(strExtension))==-1
|| strExtension==_T("exe") ||strExtension==_T("lnk")|| pFI->m_Attributes.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)<br />
{<br />
SHFILEINFO fi;<br />
SHGetFileInfo(pView->m_strCurrentPath + pItem->pszText,pFI->m_Attributes.dwFileAttributes,&fi,sizeof(fi),SHGFI_USEFILEATTRIBUTES |SHGFI_ICON| SHGFI_SMALLICON);<br />
<br />
pItem->iImage=pView->m_ilLVIconsSmall.Add(fi.hIcon);<br />
<br />
pView->m_hIcons.Add(fi.hIcon);<br />
pFI->m_iSmallIconIndex = pItem->iImage;<br />
if(!(pFI->m_Attributes.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{<br />
IconType IT;<br />
IT.m_Extension=strExtension;<br />
IT.m_IconIndex=pItem->iImage;<br />
pView->m_IconTypeSmall.Add(IT);<br />
}<br />
<br />
}<br />
<br />
else
{<br />
pItem->iImage=iIconIndex;<br />
pFI->m_iSmallIconIndex = iIconIndex;<br />
<br />
}<br />
CString str;<br />
str.Format(_T("%d"),pView->m_ilLVIconsSmall.GetImageCount());<br />
GetParent()->GetParent()->SetWindowText(str);<br />
<br />
}
if(pView->m_iLVStyle == LVS_ICON)<br />
{<br />
if(pFI->m_iLargeIconIndex!=-1)<br />
{<br />
pItem->iImage=pFI->m_iLargeIconIndex;<br />
return;<br />
}<br />
<br />
int iIconIndex;<br />
CString strExtension=CFileFolderManager::GetFileExtension((CString)pItem->pszText);<br />
if((iIconIndex=pView->GetTypeIconLarge(strExtension))==-1
|| strExtension==_T("exe") ||strExtension==_T("lnk")|| pFI->m_Attributes.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)<br />
{<br />
IconType IT;<br />
IT.m_Extension=strExtension;<br />
SHFILEINFO fi;<br />
<br />
SHGetFileInfo(pView->m_strCurrentPath + pItem->pszText,pFI->m_Attributes.dwFileAttributes,&fi,sizeof(fi),SHGFI_USEFILEATTRIBUTES |SHGFI_ICON| SHGFI_LARGEICON);<br />
<br />
IT.m_IconIndex=pItem->iImage=pView->m_ilLVIconsLarge.Add(fi.hIcon);<br />
pView->m_IconTypeLarge.Add(IT);<br />
pView->m_hIcons.Add(fi.hIcon);<br />
pFI->m_iLargeIconIndex= IT.m_IconIndex;<br />
<br />
}<br />
<br />
else
{<br />
pItem->iImage=iIconIndex;<br />
pFI->m_iLargeIconIndex= iIconIndex;<br />
<br />
}<br />
CString str;<br />
str.Format(_T("%d"),pView->m_ilLVIconsLarge.GetImageCount());<br />
GetParent()->GetParent()->SetWindowText(str);<br />
<br />
}
<br />
}
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
hi,
I want to create a file association programmatically using vc++, for example, I want to associate '.txt' files with myprogram.exe.
are there any api functions to do this?
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Not sure if there are any directly, but the file associations are stored in the registry, you can use registry APIs to set them up.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks,
but when I change these settings from registry will the settings take effect immediately or do I need to restart windows or restart windows explorer??
I need a method that takes effects immediately.
Thanks alot
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
|
haha, very easy.
1.) Right-click on the .txt file,
2.) Choose "Properties",
3.) Choose "Browse",
4.) Then choose your program name, ie. myprogram.exe
Enjoy
|
|
|
|
|
|
36 hours straight and my mind is starting to go blank. What is a quick and easy way to convert a string to a DWORD? The string is an 8 char representation of a hash value, I will use it as a key in the registry.
|
|
|
|
|
wow, I didn't even realise this set of functions existed, and here's me thinking of bit shifting!!
dwKey = strtoul(key,0,16);
|
|
|
|
|
Hello
I am trying to keep a window within a certain bounding rect. So far I am capturing the WM_ENTERSIZEMOVE message within the window procedure and doing this:
boundry is the program defined rect that the user should stay within.
pt is the mouse POINT.
rect is the window RECt.
<br />
test.left = boundry.left + ( pt.x - rect.left );<br />
test.right = boundry.right - ( rect.right - pt.x );<br />
<br />
test.top = boundry.top + ( pt.y - rect.top );<br />
test.bottom = boundry.bottom - ( rect.bottom - pt.y );<br />
<br />
ClipCursor( &test );
There are a few problems that arise, one of them is that depending on where i grab the window, the resulting boundry rect is sometimes off by as much as a few pixels.
Whats the dilly?
|
|
|
|
|
Didn't you ask this question the other day? And didn't I recomend using the WM_GETMINMAXINFO rather than trying to do it manually. And did it work?
|
|
|
|
|
Yah I did, And no I couldn't get it to work properly. It was only working for the resizing of the window, not the moving. This is what i wrote:
<br />
<br />
case WM_GETMINMAXINFO:<br />
<br />
<br />
wndInfo = (MINMAXINFO *)lParam;<br />
<br />
wndInfo->ptMaxPosition.x = boundry.left;<br />
wndInfo->ptMaxPosition.y = boundry.top;<br />
<br />
wndInfo->ptMaxSize.x = boundry.right - boundry.left;<br />
wndInfo->ptMaxSize.y = boundry.bottom - boundry.top;<br />
<br />
wndInfo->ptMaxTrackSize.x = boundry.right;<br />
wndInfo->ptMaxTrackSize.y = boundry.bottom;<br />
<br />
wndInfo->ptMinTrackSize.x = boundry.left;<br />
wndInfo->ptMinTrackSize.y = boundry.top;<br />
<br />
ret = 0;<br />
break;
Was I missing somthing?
|
|
|
|
|
Maybe this[^] will help you.
|
|
|
|
|
Thanks for the article, It seems that only the resizing is being handled though, not the moving.
|
|
|
|
|
Well I ended up going about it this way, now i just need to figure out how to stop the cursor from moving in the case that it goes within the if statements, any ideas?
case WM_SIZING:<br />
case WM_MOVING:<br />
winRect = (RECT *) lParam;<br />
<br />
winWidth = winRect->right - winRect->left;<br />
winHeight = winRect->bottom - winRect->top;<br />
<br />
if ( winRect->left < boundry.left )<br />
{<br />
winRect->left = boundry.left;<br />
if ( Msg == WM_MOVING ) winRect->right = winRect->left + winWidth;<br />
}<br />
<br />
if ( winRect->top < boundry.top )<br />
{<br />
winRect->top = boundry.top;<br />
if ( Msg == WM_MOVING ) winRect->bottom = winRect->top + winHeight;<br />
}<br />
<br />
if ( winRect->bottom > boundry.bottom )<br />
{<br />
winRect->bottom = boundry.bottom;<br />
if ( Msg == WM_MOVING ) winRect->top = winRect->bottom - winHeight;<br />
}<br />
<br />
if ( winRect->right > boundry.right )<br />
{<br />
winRect->right = boundry.right;<br />
if ( Msg == WM_MOVING ) winRect->left = winRect->right - winWidth;<br />
}<br />
<br />
counter++;<br />
sprintf( buffer2, "In WM_SIZING/WM_MOVING this many times: %d", counter );<br />
charCount = SetWindowText( hWnd, buffer2 );<br />
<br />
return true;
Thanks,
Ben.
|
|
|
|
|