|
Hello dear ATL experts,
While trying to compile a VC++ 6.0 project with VC++ 7.1, I have got the following error :
d:\TESTINGONLY\dbstudio\DSIFormat.h(58) : error C2664: '_com_ptr_t<_IIID>::_com_ptr_t(int)' : cannot convert parameter 1 from 'ATL::CComPtr<T>' to 'int'
with
[
_IIID=_com_IIID<StdFormat::IStdDataFormatDisp,& _GUID_6c51b910_900b_11d0_9484_00a0c91110ed>
]
and
[
T=StdFormat::IStdDataFormatDisp
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
This error is caused by the following instanciation
CComPtr<StdFormat::IStdDataFormatDisp> m_fmtBinary;
StdFormat::IStdDataFormatDisp is located in a .tlh file.
I am a newbee with COM and I guess it is an interface generated by the compiler.
Here is its definition
struct __declspec(uuid("6c51b910-900b-11d0-9484-00a0c91110ed"))
IStdDataFormatDisp : IDataFormatDisp
{
//
// Property data
//
__declspec(property(get=GetType,put=PutType))
enum FormatType Type;
__declspec(property(get=GetFormat,put=PutFormat))
_bstr_t Format;
}
It derives from
struct __declspec(uuid("e675f3f0-91b5-11d0-9484-00a0c91110ed"))
IDataFormatDisp : IDispatch
{};
IDataFormatDisp does nothing so I wonder why not deriving IStdDataFormatDisp direcly from IDispatch
Indeed the project works fine with visual c++ 6.0.
I thank you very much for your help.
|
|
|
|
|
Hi everybody,
If I can't find the question here, I wouldn't know were to look.
We handle 500 MB plus point cloud files from a CT Scanner in the dental field, from which large parts needs to be cut away and the output of material difference/artifacts needs to be cleaned up, before we can file this data as STL File. Now opening and working with these large files consume quit a lot of time. I am looking for a tool that enables us to work on these large files more easily.
For your information, I am not a programmer, for that reason I can only express myself in describing how I think it could work, which is as follows;
The tool could be a kind of pre point cloud reducer in form of an STL. This tool being able to reduce very large files, such as 500 MB or more point cloud, into 10% or less, then cutting and cleaning the surface in this <50MB file, and translating this information back to the original pointcloud file, in which all the cut areas and artifactes then are removed. The endresult is filled as STL.
Is there someone that has experience in this matter. It would be a great help if there was some kind of application that does this trick.
Thanks for your help, it's highly appreciated.
Malte de Moll
|
|
|
|
|
By STL, do you mean this[^]? Because the STL discussed in this forum is this one[^], which is very different. If this is the case, I suspect you're not going to get any useful responses
|
|
|
|
|
Hello dear friends,
How can we use the events of the JScript in ATL COM DLL?
Application scenario:
I've toolbar which is written in ATL.I want the toolbar to communicate with the the JScript.For example in Google toolbar you can add new button in the toolbar by clicking a button on the webpage.
I've webpage and when user pressed for example a link, I want that my
toolbar should be informed of this thing with the name of the link pressed to the toolbar.
A sample code is greatly appreciated.
ritz1234
|
|
|
|
|
Hi all,
How do I manipulate a checkbox?
I declared it as:
bool Check;
BEGIN_DDX_MAP(CPreferenceDlg)
DDX_CHECK(IDC_CHECK1, Check)
END_DDX_MAP()
How can I know if the checkbox is checked or not? If CComboBox is for combo box what is for a check box and listbox? How will I also declare a listbox?
This is what I do if its a textbox:
c_edEdit4.GetLine(0, Mail.GetBuffer(c_edEdit4.LineLength(0)));
Mail.ReleaseBuffer();
Email = Mail;
if (RegSetValueEx(Regentry,
_T("EmailAddress"),
0,
REG_SZ,
(LPBYTE) Email.c_str(),
(DWORD) (lstrlen(Email.c_str())+1)*sizeof(TCHAR)))
{
printf("Could not set the event message file.");
RegCloseKey(Regentry);
return 0;
}
Thanks,
Jayjay
|
|
|
|
|
I got it how i will get the value of the checkbox. Another question though. Now I am able to save at the registry if the checkbox is checked or not question is how can I make the checkbox checked already if it was saved as checked.
|
|
|
|
|
If you're using WTL/MFC and you've wrapped the control in a WTL/MFC CButton class, you use the SetCheck methods.
If you're using raw Win32, send the BM_SETCHECK message to the control's window.
|
|
|
|
|
Hi Stuart,
Thank I now got it sorted. Now arise another puzzle for me, with a checkbox unchecked I will have to disable two comboboxes, now how can I enable and disable it everytime the checkbox is being checked and unchecked.
Thanks,
Jj
|
|
|
|
|
1. In the checkbox's 'OnClick' handler, enable/disable the combo-boxes.
2. If you're using WTL, check out this article[^].
|
|
|
|
|
I made this button thats supposed to open an choose folder window then the user will choose a folder or create a folder where the files will be saved then the address of the folder after the user chooses will be put into a text box.
Any ideas how to do that?
Thanks
|
|
|
|
|
If you're using WTL, then you want CFolderDialog - see Michael Dunn's excellent article[^].
Otherwise, You need SHBrowseForFolder[^] for the whole choosing/creating a folder thing. I'll give you 10 extra bonus points if you can get it to start up displaying a folder of your choice (hint: you need to register a callback in the lpfn member of the structure whose address you pass as a parameter, and that callback needs to respond to BFFM_INITIALIZED by sending the BFFM_SETSELECTION with the folder).
Oh, and retrieving the folder that was selected? Yeah, you'll need to get friendly with PIDL s.
Alternatively, you could use the nice, easy to use wrapper for SHBrowseForFolder from this CP article[^]. Might be a little easier than using SHBrowseForFolder yourself.
|
|
|
|
|
Now i am having trouble with this:
BufferSize = TOTALBYTES;
PPERF_DATA_BLOCK PerfData = (PPERF_DATA_BLOCK) malloc( BufferSize );
Size = BufferSize;
dwRet = RegQueryValueEx(Regentry, _T("DownloadPath"), NULL, &Type, reinterpret_cast<LPBYTE>(DownloadPath), &Size);
while( dwRet == ERROR_MORE_DATA )
{
BufferSize += BYTEINCREMENT;
PerfData = (PPERF_DATA_BLOCK) realloc( PerfData, BufferSize );
Size = BufferSize;
dwRet = RegQueryValueEx(Regentry, _T("DownloadPath"), NULL, &Type, reinterpret_cast<LPBYTE>(DownloadPath), &Size);
}
if( dwRet == ERROR_SUCCESS )
{
Path = DownloadPath;
}
else if ( dwRet == ERROR_FILE_NOT_FOUND )
{
if (RegSetValueEx(Regentry,
_T("DownloadPath"),
0,
REG_SZ,
(LPBYTE) &dwData,
(DWORD) (lstrlen(Path.c_str())+1)*sizeof(TCHAR)))
{
printf("Could not set the DownloadPath.");
RegCloseKey(Regentry);
return 0;
}
}
else
{
printf("Could not set the DownloadPath.");
RegCloseKey(Regentry);
return 0;
}
I am getting 'PPERF_DATA_BLOCK' : undeclared identifier, what can I do for that? What do I need to include?
These are my headers:
#include <atlapp.h>
#include <atlframe.h>
#include <atlctrls.h>
#include <atldlgs.h>
#include <atlctrlw.h>
#include <atlwin.h>
#include <iostream>
#include <atlmisc.h>
#include <malloc.h>
#include <stdio.h>
#include <windows.h>
#include <stdlib.h>
#include <string.h>
|
|
|
|
|
Looking at PERF_DATA_BLOCK in MSDN, it says 'Header: Declared in Winperf.h; include Windows.h.'.
You have included Windows.h, which makes me suspect there's a macro getting in the way. Looking at Windows.h, it won't include WinPerf.h if the macro WIN32_LEAN_AND_MEAN is defined - I seem to remember that an auto-generated stdafx.h does define WIN32_LEAN_AND_MEAN . Check for that.
PS - I compiled this code successfully (just these two lines) using the command-line C++ compiler, which says that there must be something in your setup or software that's stopping PPERF_DATA_BLOCK being defined.
#include <Windows.h>
PPERF_DATA_BLOCK p = new PERF_DATA_BLOCK;
|
|
|
|
|
Thanks already done with it.
|
|
|
|
|
Hi EveryOne,
I am savitri.I am new to Com programming.I am doing project on GSM modem to send and receive message.I want to use existing dll file for example(comdlg32.dll).Please tell me how shall i use that in my program.please tell me procedure.
it is urgent.Help me.
Regards,
savitri
|
|
|
|
|
Don't cross-post, this is considered rude !
|
|
|
|
|
hi moonen,
it means..wt i did tell me.
regards
savitri
|
|
|
|
|
savitri wrote: it means..wt i did tell me.
Could you please translate that into english so that I can understand ?
|
|
|
|
|
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Hi Savitri,
Use CoCreateInstance to co-create your component. Once you get the interface pointer, you can call its functions.
Finally, don't forget to release the component after you finish your work.
See the help on CoCreateInstance and Release in MSDN .
|
|
|
|
|
Hoe to retrive the html text box input using IHTMLElemt interface.
|
|
|
|
|
innerText property [^] looks promising. See also [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
The docs says:
Most Boost libraries are header-only
So does it compiles very slow?
And any way to make it fast?
|
|
|
|
|
Boost libraries will slow down compilation, mainly due to the amount of code in the headers and the number of template instantiations needed. To speed it up, include Boost headers into a pre-compiled header. But not Boost.Bind or Boost.Lambda headers, as they use declare some objects that need to be single instance, and putting them in pre-compiled headers can mess that up.
You need to balance the convenience that Boost headers get you against the compile times. It's worth it 99% of the time.
|
|
|
|
|
I can't understand why it is worth. 99% of the time when using boost, I think the document should be enough, is it?
|
|
|
|