|
I tried this method but I am having linking problems
Here is what I have in my exe
#define EXE_API __declspec(dllexport)
EXE_API BOOL Message(CSystem * pSystem, IMessage * pMessage );
Here is what I have in my plugin:
#pragma comment( lib, "core.lib" ) // lib of the exe
#define EXE_API __declspec(dllimport)
EXE_API BOOL Message(CSystem * pSystem, IMessage * pMessage );
Here is the function in the plugin trying to return a message back to the .exe
BOOL PluginA::OnMessage( CSystem* pSystem, IMessage* pMessage, BOOL* Result )
{
CSystem * pSys = NULL;
IMessage * pMsg = NULL;
Message( pSys, pMsg );
return TRUE;
}
Here is the linker error
HTPCPLUGIN error LNK2019: unresolved external symbol
"int __cdecl Message(class CSystem *,class IMessage *)"
(?Message@@YAHPAVCSystem@@PAVIMessage@@@Z) referenced
in function "public: virtual int __thiscall
PluginA::OnMessage(class CSystem *,class IMessage *,int *)" (?OnMessage@PluginA@@UAEHPAVCSystem@@PAVIMessage@@PAH@Z)
Did I miss something?
|
|
|
|
|
I am working on a plug-in application similar to this. The actual EXE belongs to IBM and my part is just a DLL. The two communicate via COM interfaces. We add a few entries to the registry so that the EXE knows that our plug-in exists, and when certain events happen our plug-in is "notified" through a few standard interfaces. I know this is unlike what you are doing, but I just wanted to mention that this is at least one other way for "generic" EXEs to communicate with plug-in DLLs.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks for this alternate approach. I was trying to steer clear of COM. My project started out simple and seems to grow exponentially is terms of complexity and technologies used.
Step 1) I just want a simple program that can simulate a HTPC front-end.
Step 2) It would be nice if the interface was XML based.
Step 3) Needs some direct-x cause gdi+ is so slow.
Step 4) I want to add plug-in technology. Max ability Min coupling. ( not asking much
Step 5) My back sure is itchy.... Back scratching functionality
|
|
|
|
|
Hi all,
I am using the Dundas Ultimate Toolbox in one of my MFC Programs (VC6). Sometimes (and this is exactly the problem), the program makes a debug assertation in this function:
COXMultiComboBox::OnMeasureItem
in this line:
ASSERT(AfxIsValidAddress(pRowData, sizeof(COXRowData)));
Any ideas ?
All the label says is that this stuff contains chemicals "... known to the State of California to cause cancer in rats and low-income test subjects." Roger Wright http://www.codeproject.com/lounge.asp?select=965687&exp=5&fr=1#xx965687xx
|
|
|
|
|
system information:win XP + sp2 + Microsoft Data Access Components 2.8 + VC++6.0 + Access.
application works well before i update pack to sp2, but since then it cannot work.i find the it is crashed when it run sql
"SELECT DISTINCT Info.* FROM Info WHERE Deleted = 0 ORDER BY ID DESC". i run this sql in access and it is well. i think it is winxp sp2's problem. so please give me some suggestion about it. codeguru[^]
Happy Gemini
|
|
|
|
|
Hi, I have a simple code.
#include "stdafx.h"<br />
#include <iostream><br />
using namespace std;<br />
<br />
#include <cstdlib><br />
#include <ctime><br />
typedef int DataType;<br />
<br />
void selectionSort( DataType theArray[], int n );<br />
int indexOfLargest( const DataType theArray[], int size );<br />
void mySwap( DataType& x, DataType& y );<br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
return 0;<br />
}<br />
<br />
void selectionSort( DataType theArray[], int n )<br />
{<br />
for (int last = n-1; last >= 1; --last)<br />
{ <br />
int largest = indexOfLargest(theArray, last+1);<br />
<br />
mySwap(theArray[largest], theArray[n - last]);<br />
<br />
}
}
<br />
int indexOfLargest( const DataType theArray[], int size )<br />
{<br />
int indexSoFar = 0;
for (int currentIndex = 1; currentIndex < size; ++currentIndex)<br />
{
if (theArray[currentIndex] > theArray[indexSoFar])<br />
indexSoFar = currentIndex;<br />
}
<br />
return indexSoFar;
}
<br />
void mySwap( DataType& x, DataType& y )<br />
{<br />
DataType temp = x;<br />
x = y;<br />
y = temp;<br />
}
Compiler gives the error
d:\CD\myProjects\hw2Q4\hw2Q4.cpp(14): fatal error C1075: end of file found before the left brace '{' at 'd:\CD\myProjects\hw2Q4\hw2Q4.cpp(13)' was matched
There is no unmatched curly, any help would be appricated.
|
|
|
|
|
add:
#include <tchar.h>
after
#include "stdafx.h"
Steve
|
|
|
|
|
|
yes, read back your post.....
and use the "modify" link to let us see what you really #include (dont type directly < and >, they will be interpreted as HTML tags)...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
kromozom wrote:
#include "stdafx.h"
#include
using namespace std;
#include
#include
you've missed the included file names,didn't you?
|
|
|
|
|
It is a code from MSDN.
It complies and links but does not executes giving the following error
File:i386\chkesp.c
line:48
The value of ESP was not properly saved across a fuction call.This is usually a result of calling function decleared with one calling convention with a funciton pointer decleared with a different calling convention.
#include windows.h,Setupapi.h>
#include stdio.h
DWORD Err;
HDEVINFO DoDeviceEnum( GUID InterfaceClassGuid)
/*
Routine Description:
Retrieves the device information set that contains that contains
the devices of the specified class.
the devices of the specified class.
Parameters:
InterfaceClassGuid - The interface class GUID.
Return Value:
If the function succeeds, the return value is a handle to the
device information set.
If the function fails, the return value is zero.
*/
{
HDEVINFO DeviceInfoSet;
HDEVINFO NewDeviceInfoSet;
// Create a device information set that will be the container for
// the device interfaces.
DeviceInfoSet = SetupDiCreateDeviceInfoList(NULL, NULL);
if(DeviceInfoSet == INVALID_HANDLE_VALUE) {
Err = GetLastError();
printf( "SetupDiCreateDeviceInfoList failed: %lx.\n", Err );
return 0;
}
// Retrieve the device information set for the interface class.
NewDeviceInfoSet = SetupDiGetClassDevsEx(
&InterfaceClassGuid, // address of guid required
NULL, // no enumerator
NULL, // no parent window handle (might not be a good idea…)
DIGCF_PRESENT | DIGCF_DEVICEINTERFACE, // flags
//DeviceInfoSet, // do not pass this in, not in function prototype
NULL, // NULL implies local machine
NULL // Reserved’ must be null
);
if(NewDeviceInfoSet == INVALID_HANDLE_VALUE)
{
Err = GetLastError();
printf( "SetupDiGetClassDevsEx failed: %lx.\n", Err );
return 0;
}
return NewDeviceInfoSet;
}
int main(int argc, TCHAR* argv[])
{
GUID var;
DoDeviceEnum(var);
return 0;
}
|
|
|
|
|
Is there anyone out there working on creating a chart program or already created one that uses (8) samples to draw the lines? Program also needs to allow user to select up to 100 samples for line smoothness. I am working on such a program and need some help finishing it. Thanks to all who can help.
|
|
|
|
|
I need a DateTimePicker that acts like a CComboBox when the drop down arrow is invoked. More specifically, I need the DateTimePicker so that the user can adjust a date as needed, but when the user selects the drop down arrow, he is able to select from a finite number of strings stored in the CComboBox.
For instance: if the DateTimePicker showed the date (which can easily be adjusted by the user) 1/1/2000, the drop down arrow would display:
5/7/1999
4/12/1998
1/20/1996
3/15/1990
Does anyone know how I can set about creating this hybrid monster?
|
|
|
|
|
Hi, I have a textbox on the main form and I want to read in some text files to it, I don't want to use MFC.
I have an OPENFILENAME structure and I can read the file, but I can't extract the file's contents into the textbox. For example I have a file called MyFile.txt and I want the text in that file to be loaded into my text box. I hope I explained it well enough.
Thank you in advance for your help.
The only thing you can count on in life is death.
|
|
|
|
|
Have you looked into CreateFile() , and ReadFile() ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Read my iostream articles for the standard way to retrieve information from files.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
go for the basic ones.....fgetc(),fopen()....tis just a suggestion!!!
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
What command do I need to to use to determine the check state of a menu item in another app?
As an example lets use the "View > Status Bar" In IE. I wish to create an app that will determine the check state, and give a visual indication, as this app, unlike the status bar, has no visual unless you look at the menu itself.
Jeff
|
|
|
|
|
Well, the trouble you have is that the check state is generally determined JUST before the menu item is shown. There's a message that's called before a menu item becomes visible, and it's set to be checked there. So the only way for this code to execute in the other app is for the menu to be clicked ( ignoring all your other issues with controlling it from another app for a moment ).
Why do you need this ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
To make a long story short, I have a DJ application that allows me to hide items with a rating of zero. This is a menu item with check. I wish to have an indicator on my helper app that gives me a visible status of this setting, as well as if logging is turned on or off.
I am able to determine the state with the madcodehook, but wish to accomplish this without it's use.
http://help.madshi.net/madCodeHook.htm[^]
If I can bring it up in a known state, it wouldn't be an issue. I'm sure there is a setting in the registry for this, just not sure were it would be.
|
|
|
|
|
Maybe I just haven't seen a good example of parsing input, but you'd think it would be easier. This is what I've seen done:
...
char input[20];
string theString;
cin.getline(input, 20);
theString = string(input);
myObject A(theString);
...
But, I need to parse theString in the constructor of A , so I need to do something like...
...
private:
int firstNumber;
...
int x = 0;
while(isdigit(theString[x])) {
x++;
}
firstNumber = atoi(theString.substr(0,x));
...
...which doesn't work. If anybody could share the more elegant (and functional ) approach that they use, I would be most gratefull.
|
|
|
|
|
For starters, I prefer this:
string s;
getline( cin, s );
to creating an array needlessly.
Then, have you stepped through to see what's going on ? Where does it 'fail' ? Do you get back the entire string/nothing/half a number ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Well, I get this compile error:
error C2664: 'atoi' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
The exact line is:
<br />
whole = atoi(theString.substr(0, x));<br />
where x and whole are integers.
|
|
|
|
|
I should have looked more closely. atio is a C library function, it knows nothing of classes or the STL. You need to call the c_str() function on the string to get back a const char *.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks Christian. I changed my code to:
<br />
whole = atoi((theString.substr(0, x)).c_str());<br />
and all is well. Thanks alot!
|
|
|
|