|
If you look up error 2304, it reads;
MIDL2304: attribute invalid on a procedure in an [object] interface
The specified attribute is not allowed on procedure in a COM interface.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
I want my method return Keyboard messages?(It hook keyboard message)
What attribute my method should have and what it should return?
|
|
|
|
|
Hi, I was wondering if anyone out there knew of a place where I might either buy or obtain (open-source) a copy of an "intellisense" control, similar to that of Visual Studio? I am in the process of working on an editor and such a control would be awesome.
|
|
|
|
|
Didn't understand your post at all, lmao. But according to Subject, I see you want an Autocompletion.... The only thing.... Not ListBox, but ComboBox..
Well, look in MSDN for interface IAutoComplete
Hope this is what you want
Philip Patrick
"Two beer or not two beer?" (Shakesbeer)
Web-site: www.saintopatrick.com
|
|
|
|
|
Hi, thanks for replying, however, I was trying to ask whether a "popup intellisense menu" existed as separate control. You know how in MSVC, after you type a "." or a "->", all the class members of the object you are dealing with will be displayed? I would like to incorporate "intellisense" into my very own, homegrown editor.
|
|
|
|
|
Try this:
http://www.ticz.com/homes/users/nlewis/index.html?target=intro
LEt me know if you have any questions on usage.
|
|
|
|
|
Dude. This is EXACTLY what I was looking for! Thanks a million.
|
|
|
|
|
What's wrong with the following?
#include <vector>
class kConfig
{
protected:
public:
typedef int (*cheese)(void*);
struct kconfig_handler{
char* settingName,
cheese handlerFunc,
void* pObject;
};
kConfig();
~kConfig();
void registerHandlers(kconfig_handler[] handlers);
int loadConfig(char* pchFilename);
private:
std::vector< kconfig_handler* > m_settingList;
};
I keep getting this error when i try to compile:
f:\software\katie\include\kconfig.h(24) : error C2146: syntax error : missing ';' before identifier 'handlerFunc'
That error refers to the line
cheese handlerFunc,
Stephen Caldwell
Blackfission, CEO
http://blackfission.myip.org:81
|
|
|
|
|
struct kconfig_handler {
char* settingName,
cheese handlerFunc,
void* pObject;
}; You have commas there instead of semicolons.
--Mike--
My really out-of-date homepage
"Hey, you wanna go to the Espresso Pump and get sugared up on mochas?"
-- Willow Rosenberg
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
No wonder, and to think I make structs all the time. How could that have happened? I guess age has caught up with me (17 years).
Stephen Caldwell
Blackfission, CEO
|
|
|
|
|
Heh, I type , instead of ; in for loops all the time and it bugs the heck out of me.
--Mike--
My really out-of-date homepage
"Hey, you wanna go to the Espresso Pump and get sugared up on mochas?"
-- Willow Rosenberg
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
When I help my team mate with VB occasionally I have trouble when I press ENTER because I can't help terminating the statements with a ';' and the VB auto syntax checker pops up the error dialog
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
How can I write my own stream?
I need to write a stream class and redirect cerr to it. Based on the class settings I will log it to a file or a database.
I need to use the class like below
#include <iostream>
#include <fstream>
int main()
{
std::ofstream logFile("out.txt");
std::streambuf *outbuf = std::cout.rdbuf(logFile.rdbuf());
std::streambuf *errbuf = std::cerr.rdbuf(logFile.rdbuf());
// do the actual work of the program;
// GUI code and event loop would go here
std::cout << "This would normally go to cout but goes to the log file\n";
std::cerr << "This would normally go to cerr but goes to the log file \n";
logFile << "This goes to the log file\n";
// end of program body
// restore the buffers
std::cout.rdbuf(outbuf);
std::cerr.rdbuf(errbuf);
}
But my class will log to the disk or log to a DBMS.
Regards,
Xavier
|
|
|
|
|
Here's one I wrote that uses WM_COPYDATA to send a line when it finds a \r
template <class chart,="" class="" traits="">
class DebugStr : public std::basic_streambuf<chart, traits="">
{
public:
DebugStr()
{
m_ParenthWnd = m_DebughWnd = NULL;
};
HWND m_ParenthWnd, m_DebughWnd;
protected:
std::string m_string;
int_type overflow(int_type c = traits_type::eof())
{
if (c != traits_type::eof())
{
if ('\n' == c)
{
// We check to make sure we have the HWND and it's still valid.
if (m_DebughWnd && ::IsWindow(m_DebughWnd))
{
COPYDATASTRUCT cds;
cds.cbData = m_string.size();
cds.lpData = (void*)(LPCSTR)m_string.c_str();
::SendMessage(m_DebughWnd, WM_COPYDATA, (WPARAM)m_ParenthWnd, (LPARAM)&cds);
}
m_string = "";
}
else
{
m_string += traits_type::to_char_type(c);
// If we have the parent window, but not the debug window, or it's become invalid,
// we call Init again and attempt tp find it.
if (m_ParenthWnd && (!m_DebughWnd || !::IsWindow(m_DebughWnd)))
{
SDebug::Init(m_ParenthWnd);
}
}
return c;
}
return traits_type::not_eof(c);
};
};
Through the details of my implimentation you should find a skeleton there you can use to create a stream.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I wanna play multiple AVIs,but a interval of silence occured when file1 finished and file2 is rendering.How can i avoid that ?
Any Pointer or hint will be appreciated !
Thanks a lot!!
|
|
|
|
|
Hi,
I am embedding MSWord In my application, using OLE automation.
Code As Follows
/*******************************************************************
This method encapsulates the process of embedding a Word document
in a View object and automating that document to add text.
*******************************************************************/
//Change the cursor so the user knows something exciting is going
//on.
BeginWaitCursor();
CWordContainerCntrItem* pItem = NULL;
TRY
{
//Get the document associated with this view, and be sure it's
//valid.
CWordContainerDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
//Create a new item associated with this document, and be sure
//it's valid.
pItem = new CWordContainerCntrItem(pDoc);
ASSERT_VALID(pItem);
// Get Class ID for Word document.
// This is used in creation.
CLSID clsid;
if(FAILED(::CLSIDFromProgID(L"Word.Document",&clsid)))
//Any exception will do. You just need to break out of the
//TRY statement.
AfxThrowMemoryException();
// Create the Word embedded item.
if(!pItem->CreateNewItem(clsid))
//Any exception will do. You just need to break out of the
//TRY statement.
AfxThrowMemoryException();
//Make sure the new CContainerItem is valid.
ASSERT_VALID(pItem);
// Launch the server to edit the item.
pItem->DoVerb(OLEIVERB_SHOW, this);
// As an arbitrary user interface design, this sets the
// selection to the last item inserted.
m_pSelection = pItem; // set selection to last inserted item
pDoc->UpdateAllViews(NULL);
//Query for the dispatch pointer for the embedded object. In
//this case, this is the Word document.
LPDISPATCH lpDisp;
lpDisp = pItem->GetIDispatch();
//Add text to the first line of the document
_Document doc;
_Document ActiveDoc;
Selection selection;
_Application app;
PageSetup pagesetup;
_Font font;
//set _Document doc to use lpDisp, the IDispatch* of the
//actual document.
doc.AttachDispatch(lpDisp);
//Then get the document's application object reference.
app = doc.GetApplication();
// From there, get a Selection object for the insertion point.
selection = app.GetSelection();
selection.SetText("This is a good place to say \"Hello World\"");
// Automate setting the values for various properties.
font = selection.GetFont();
font.SetName(_T("Tahoma"));
font.SetSize(12);
selection.SetFont(font);
But SaveAs method is not available ......
_Document oActiveDoc;
oActive = app.GetActiveDocument();
oActive.SaveAs(.....................);
--> Exception Error~!!!
|
|
|
|
|
I am trying to build several sample apps that let you use the MS Activex scripting engine in your apps and I get the following linker error with all of them:
ScriptEngineFactory.obj : error LNK2001: unresolved external symbol _IID_IActiveScriptParse
I assume this is quite a basic problem but I haven't been able to work out how to resolve it so far.
For an example of one such app see: Hosting VBScript in your own Application
I've just worked out this is happening on XP, but not on W98.
Any assistance much appreciated.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hi all.
In my application (MFC), I need to develop a network White Board that will be able to open and share MS Office documents.
I didn't find any other way to open and use a Powerpoint document but to use Automation. I do not want (and it is not possible anyway) to install Office on any of the machine the software will run on. I found Powerpoint Viewer and derived the classes from Msppt8vr.olb (using ClassWizard) to be included in my application. I would prefer to be able to read the Powerpoint file format instead of using Automation, but it looks like I have no other choice unless MS decide to release the specs of their format or (and this is what I hope) someone already managed to read and work with this format.
Anyhow. After spending days looking for infos over the web (most of the MS documentation is for VB) I found the right way to use Automation for Powerpoint Viewer (which is different than Powerpoint). But still, when I create the object through OLE Automation, the CreateDispatch function failed and I have no clue why. Here's my code:
[CODE]
void CCtipptDlg::OnButtonPpttest()
{
_Application app;
SlideShowView ctippt;
COleException e;
CLSID clsid;
// Create the object that we'll drive through OLE automation.
if (CLSIDFromProgID(OLESTR("PowerPointViewer.Application"), &clsid) != NOERROR)
{
AfxMessageBox("CLSIDFromProgID Error!");
return;
}
if (!app.CreateDispatch(clsid, &e))
{
AfxMessageBox("CreateDispatch Error!");
return;
}
}
[/CODE]
The first IF statement (CLSIDFromProgID) returns with no errors, meaning that it's finding the CLSID just fine in the MS registry (I also doubled checked manually in the registry and its fine).
But the second IF statement (CreateDispatch) fails and the thing doesn't create the object!
If anyone has a clue about why it doesn't work, let me know.
Thanks a lot in advance, guys...
|
|
|
|
|
You might want to start off by looking at e.m_strDescription, which should contain a description of what is going wrong. Of course it'll likely be something like "Error 123xyz: Method Failed"
Pete
|
|
|
|
|
Thanks Pete. I'll have a look at it right away.
I'll post something as soon as I get some result.
|
|
|
|
|
Thanks a lot. You pointed me in the right direction, though I didn't use (because I didn't find it) m_strDescription. Instead, I did this:
void CCtipptDlg::OnButtonPpttest()
{
_Application app;
SlideShowView ctippt;
COleException e;
CLSID clsid;
TCHAR szCause[255];
// Create the object that we'll drive through OLE automation.
if (CLSIDFromProgID(OLESTR("PowerPointViewer.Application"), &clsid) != NOERROR)
{
AfxMessageBox("CLSIDFromProgID Error!");
return;
}
CoInitialize(NULL);
if (!app.CreateDispatch(clsid, &e))
{
e.GetErrorMessage(szCause, 255);
AfxMessageBox(szCause);
return;
}
}
Inside the second IF statement, I ran GetErrorMessage from my Exception handler (e) and it returned the message "CoInitialize not called"!!! There's no way in hell you will find anything in the MS documentation about CoInitialize in the Office Automation docs and I know what I'm talking about after spending Days on the MSDN documentation.
Anyhow, if anyone want to run an OLE automation client, here's what you'll need to do.
Thanks again Pete.
|
|
|
|
|
No Problem. I have to agree about the automation docs, I ran into similar problems trying to get some Excel automation running. In fact, I think it was exactly the same problem
|
|
|
|
|
As soon as I have some time (I seriously don't know when) I'll write some tutorials for my web site on all the tough problems I ran into in COM/MFC/OLE/ActiveX programming in the past few months.
My web site contains several tutorials on how to develop 3D video games using the Genesis3D engine but I discovered that more and more programmers are looking for infos and tutorials just about everything.
Anyhow, thanks again. This was really critical for me.
|
|
|
|
|
Does anyone know why this code:
void Cfoobar::Serialize( CArchive &ar )
{
int int_val;
bool bool_val;
...
...
ar >> int_val;
ar >> bool_val;
ar >> (int)bool_val;
...
...
}
throws up compilation errors for the bool variable, even if I cast it into int?
The errors read:
... error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'bool' (or there is no acceptable conversion)
... error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'int' (or there is no acceptable conversion)
What obvious point have I missed?
TIA,
Pete
|
|
|
|
|
int nBoolVal;<br />
bool bRealBoolVal;<br />
<br />
ar >> nBoolVal;<br />
bRealBoolVal = (nBoolVal != 0);
As for why? Probably because MFC pre-dates the C++ bool type, so everything is done with BOOL s.
--Mike--
My really out-of-date homepage
"Hey, you wanna go to the Espresso Pump and get sugared up on mochas?"
-- Willow Rosenberg
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|