|
How about NetWkstaGetInfo() ?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello Everybody,
I have a question regarding the usage of Export / Import XML files into MS
Project 2003.
I plan to write a client application (VC++ ) which could import a MS Project file
(Importable XML File) into MS Project without opening the MS Project 2003
application.
A manual way of reimporting an exported MS Project File is possible. i
wanted this to be done by the client application.
* This application should be able to import the project xml file into MS
Project 2003.
* also Save the project file in its primitve format ".mpp" automatically if possible.
Shall be thankful for any ideas or suggestions,
Sreenivas MK
mksreenivas
|
|
|
|
|
I have an application that that loads some dll's at runtime. I am trying to design a message mechanism so that I can pass messages back and forth to and from the dll.
I have the following function in my dll:
OnMessage( CSystem * pSys, CMessage * pMsg );
And then in my exe I have the following function in my CSystem class:
OnMessage( CMessage * pMsg );
So the first function is intended to pass messages to the dll and the second function is so that the dll can pass messages back to the exe.
In the dll's OnMessage() I would like to be able to call the following:
CMessage * pMyMessage = NULL;<br />
pMyMessage = pSys->NewMessage( "Volume-Up"); <br />
<br />
pSys->OnMessage( pMyMessage );
The classes CSystem and CMessage are defined in the exe but I want to be able to use them from my dll.
How can I give the dll access to these classes without giving the source code to the plugin?
|
|
|
|
|
Maybe by using interfaces: make these classes derive from two abstract classes. Something like:
class IMessage<br />
{<br />
virtual void Func1() = 0;<br />
};<br />
<br />
<br />
class CMessage : public IMessage<br />
{<br />
void Func1();<br />
}<br />
All the functions will be defined in the .cpp file of the CMessage class. Thus, you only need to provide the header file from the IMessage and ISystem.
All your function in the dll will receive a pointer to IMessage or ISystem instead of CMessage and CSystem.
With this example, only the exe will be able to instantiate CSystem and CMessage classes. The dll will only be able to use them.
Hope this helps
|
|
|
|
|
|
--------------------Configuration: Mainscan - Win32 Debug--------------------
Linking...
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _rand already defined in libcmtd.lib(rand.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _srand already defined in libcmtd.lib(rand.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _time already defined in libcmtd.lib(time.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in libcmtd.lib(sprintf.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _memmove already defined in libcmtd.lib(memmove.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in libcmtd.lib(mbctype.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __itoa already defined in libcmtd.lib(xtoa.obj)
LINK : warning LNK4098: defaultlib "mfc42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcs42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfco42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/Mainscan.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
Mainscan.exe - 8 error(s), 4 warning(s)
Any Idea
Too many plans make the health badly...
|
|
|
|
|
you must be mix_use run_time library.
so you should be sure: the library your app based and your app use the same compile's options((/MD、/ML、/MT、/LD) .
----------------------
If you doubt yourself,then indeed you stand on shaky ground.
|
|
|
|
|
Meaning set all library projects that are part of your EXE and your EXE to use same MFC - static or dynamic.
Also set all project to use same library - MultiThreaded or not.
|
|
|
|
|
I am currently working on a project on the server side programming for Palm applications, the data from palm will transfer wirelessly to the server through Wi-Fi and i will be using CSocket programming to implement the wireless data transfer. However i wish to know whether can CSocket communicate with Palm client?
javaClaude
|
|
|
|
|
There`s no problem doing that.
On the client side (Your palm device) you should use the CCeSocket class though.
Greetings,
Davy
|
|
|
|
|
I'm doing a little exercise after reading some chapter, it's about linked list, here is the description.
Create a struct that holds an int and a pointer to another
instance of the same struct. Write a function that takes
the address of one of these structs and an int indicating
the length of the list you want created(in my case: initialize). This function will make a whole chain of these structs (a linked list), starting
from the argument (the head of the list), with each one
pointing to the next. Make the new structs using new,
and put the count (which object number this is) in the int.
In the last struct in the list, put a zero value in the pointer
to indicate that it抯 the end. Write a second function(print) that
takes the head of your list and moves through to the end,
printing out both the pointer value and the int value for
each one.
After think for a while, I'm came up with a solution, but not a completed one.
The codes goes like this:
struct link<br />
{<br />
int a;<br />
link *next;<br />
};<br />
<br />
void initialize(link * head, int nCount)<br />
{<br />
head->a = 0;<br />
head->next = new link;<br />
link *tmp = head->next;<br />
tmp->a = 1;<br />
for (int i = 2; i < nCount; i++)<br />
{<br />
link *lnk = new link;<br />
tmp->next = lnk;<br />
lnk->a = i;<br />
tmp = tmp->next;<br />
}<br />
}<br />
<br />
void print(link *head)<br />
{<br />
while (head->next) <br />
{<br />
cout << head->a << endl;<br />
head = head->next;<br />
}<br />
}<br />
<br />
int main()<br />
{<br />
link *head = new link;<br />
initialize(head, 10);<br />
print(head);<br />
}
I wonder how should I implement the initialize(...)?
|
|
|
|
|
I'm a bit rusty, so I'm not so sure if this works.
void initialize(link * head, int nCount)
{
head->a = 0;
for (int i = 1; i <= nCount; i++)
{
link *tmp = new link;
if(i!=nCount)
{
tmp->a=i;
}
else
{
tmp->a=0;
}
head->next=tmp;
head=tmp;
}
}
<italic>Work hard, Work effectively.
|
|
|
|
|
Yulianto. wrote:
void initialize(link * head, int nCount)
{
head->a = 0;
for (int i = 0; i < nCount; i++)
{
link *tmp = new link;
tmp->i+1;
head->next=tmp;
head=tmp;
}
}
Thanks but it didn't works out, and each link holds a invalid "a", in addition "head" is not head after the execution, I guess.
After testing, I found my initialize(...) seems to work, I still can't figure out exactly how?
|
|
|
|
|
Oops , sorry, I've updated my post above. Try again.
<italic>Work hard, Work effectively.
|
|
|
|
|
Just back from run your initialize(...), the result is right!thanks, gotta know exactly how!Thanks again!
|
|
|
|
|
YongSheng Li wrote:
gotta know exactly how
You might want to google for 'Linked list'.
<italic>Work hard, Work effectively.
|
|
|
|
|
Thanks!I'll have a try!
...always look on the <blink>bright
side of life...
(Whistle)
|
|
|
|
|
Hi Yulianto:
I'm confused!in main()
<br />
int main()<br />
{<br />
link *head = new link;<br />
initialize(head, 10); <br />
print(head); <br />
}<br />
|
|
|
|
|
Well, it's hard to explain. When you enter initialize, it didn't change the address of head in main. You should understand about pointer. Maybe this[^] could help.
<italic>Work hard, Work effectively.
|
|
|
|
|
The head variable is passed to the function by value, which means that it is a copy of what is being passed. Therefore, you can use the variable head any way you want in the called function without changing the original variable in main.
Example:
void myFunc(int i)
{
i = 25;
}
int main()
{
int i = 0;
myFunc(i);
return(0);
}
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
How about something like:
struct link
{
link(){}
link( const int n)
{
a = n;
next = NULL;
}
int a;
link *next;
};
struct link *first = NULL;
struct link *last = NULL;
void addhead( struct link *newlink )
{
if (NULL == last)
last = newlink;
if (NULL != first)
newlink->next = first;
first = newlink;
}
void addhead( const int num )
{
struct link *newlink = new struct link(num);
addhead(newlink);
}
void addtail( struct link *newlink )
{
if (NULL == first)
first = newlink;
if (last != NULL)
last->next = newlink;
last = newlink;
}
void addtail( const int num )
{
struct link *newlink = new struct link(num);
addtail(newlink);
}
void main( void )
{
struct link *list;
for (int x = 0; x < 10; x++)
addtail(new struct link(x));
addtail(15);
addhead(2);
addtail(288);
list = first;
while (NULL != list)
{
cout << list->a << endl;
list = list->next;
}
}
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks!I'll have a try!
...always look on the <blink>bright
side of life...
(Whistle)
|
|
|
|
|
i want to embed a tiff file in a pdf.can i use opi and ef entries?
|
|
|
|
|
i used WIN32_FIND_DATA to find the folder and file in any directory .it is showing the correct result.but not in case of Program files.it is showing me Program files as file
|
|
|
|
|
i think it is the problem of folder's name(Program files).
|
|
|
|