|
where i can use this?
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Call this when your EXE is initializing.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I have dialog based application
PLease can u explain me with example.
thanks.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
I'm assuming you are loading the DLL using LoadLibrary .
So, before calling LoadLibrary , you must call SetDllDirectory("...\\test_folder") where the parameter is the path of the folder where you have put your DLLs.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
How are you using the DLL? Are you using the companion .lib file to load functions from the DLL or are you using LoadLibrary() and GetProcAddress() combo?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
i m trying like this.
CString FilePath;
CString FolderPath;
TCHAR lpFileName[MAX_PATH+1];
GetModuleFileName(NULL, lpFileName, MAX_PATH);
FilePath = lpFileName;
int nLastIndex = FilePath.ReverseFind('\\');
if (nLastIndex!=-1)
{
FolderPath = FilePath.Left(nLastIndex);
} else
{
FolderPath = _T("\\");
}
CString dll_path=FolderPath;
dll_path=(dll_path+_T("\\test_folder"));
BOOL tt=SetDllDirectory(dll_path);
LoadLibrary(dll_path+"\\Rapi.dll");
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Are you sure SetDllDirectory() and LoadLibrary() are succeeding? You check the return values and use GetLastError() to find what went wrong if one of these functions fail.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I have finished one application which can support xp.but today i tested it on vista,it failed.
in it,thoses registry control fuctions,windows services control fuctions, some bitmap fuctions and some Gdi function fails.
Are there so many differences between those two os?
How can i deal with this?
Thanks in advance.
|
|
|
|
|
tyr2000 wrote: Are there so many differences between those two os?
Yes
tyr2000 wrote: How can i deal with this?
Maybe this[^] might help you, or some of the articles here[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi
I'm converting an existing C++ MFC project in VS2008 to Unicode. The project had previously been upgraded to VS2008 from VS2005 and is running successfully as MBCS built by VS2008. I have also successfully tested a small (new) MFC Unicode app in C++.
I set the Project Properties to "Use Unicode ..." instead of MBCS and did a rebuild. UNICODE and _UNICODE are defined in the Preprocessor directives due to 'Use Unicode ...' in the project properties. When I build I get a lot of errors related to the definition of szFaceName in CHARFORMAT2. The errors are related to the definition of CHARFORMAT szFaceName as 'char' rather than WCHAR. Looking at the definition of CHARFORMAT2 in Richedit.h it has:
#ifdef UNICODE
#define CHARFORMAT2 CHARFORMAT2W
#else
#define CHARFORMAT2 CHARFORMAT2A
#endif
and the CHARFORMAT2A line is the one highlighted - effectively saying that UNICODE is NOT defined.
I am at a loss to understand why UNICODE is undefined in Richedit.h and how to fix it. I have tried defining UNICODE and _UNICODE in stdafx.h without any success.
I'd be grateful for any help with this - its driving me crackers.
Thanks in anticipation
|
|
|
|
|
Selumbei wrote: did a rebuild.
I presume that included deleting and rebuilding your pre-compiled header (.pch) file? That's where the definition of CHARFORMAT2 probably is.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi
I made sure that my project .pch file was gone and tried again without success. However there is a second project in the solution (on which my project is dependent). When I made sure the second project's .pch file was deleted it solved the issue.
So your suggestion was spot on - thanks
Now all I have to do is go through and correct all of the 'real' errors caused by previous developers not using the transmutable macros etc
Thanks again.
|
|
|
|
|
Hi all,
I need to launch a process as the user “Administrator” while running as “SYSTEM”. This is for a Windows XP Embedded application that launches another application, but the new application has to run under the “Administrator” account. It pops up an error message box when executed as “SYSTEM”. (Yes, the "Administrator" XPe component is installed.) Does anyone have any example code that does this or something very similar?
Thanks!
Peni
|
|
|
|
|
You could use the CreateProcessWithLogonW API to do this.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
That's the first thing I tried. It doesn't work. I can't recall exactly what GetLastError() returned, but I know it didn't reveal anything obvious, which is why I was hoping for some example code.
|
|
|
|
|
I am having some problems with the code I am writing.. here is the error message I'm getting:
error C2664: 'getFirst' : cannot convert parameter 1 from 'char (*)[100]' to 'char *'
And here is the code that is involved..
#include <iostream>
#include <cstdlib>
using namespace std;
bool getFirst(char *);
bool getLast(char *);
void main()
{
char firstName[100];
char lastName[100];
bool validFName;
bool validLName;
int first;
int last;
int length;
do
{
cout << "Enter your first name in lowercase letters: ";
validFName = getFirst(&firstName);
if (!validFName) cout << "Invalid entry. Try again...\n";
} while (!validFName);
cout << "\n";
do
{
cout << "Enter your last name in lowercase letters: ";
validLName = getLast(&lastName);
if (!validLName) cout << "Invalid entry. Try again...\n";
} while (!validLName);
cout << "\nYour full name is " << firstName << " " << lastName << "\n";
first = strlen(firstName);
last = strlen(lastName);
length = (first + last);
cout << "\nYour full name has " << length << " characters\n";
}
bool getFirst(char *first)
{
int iF,lenF;
char bufFirst[100];
bool validFirst = true;
cin.getline(bufFirst,100);
lenF = strlen(bufFirst);
iF = 0;
while (validFirst && iF < lenF)
{
if ((bufFirst[iF] < 'a') || (bufFirst[iF] > 'z'))
validFirst = false;
iF++;
}
return validFirst;
}
bool getLast(char *last)
{
int iL,lenL;
char bufLast[100];
bool validLast = true;
cin.getline(bufLast,100);
lenL = strlen(bufLast);
iL = 0;
while (validLast && iL < lenL)
{
if ((bufLast[iL] < 'a') || (bufLast[iL] > 'z'))
validLast = false;
iL++;
}
return validLast;
}
I cannot figure out how to get the correct output.. It displays crazy characters and says that my string length is 330 characters long..
Any help with this please??
|
|
|
|
|
Make the following changes.
validFName = getFirst(firstName);
validLName = getLast(lastName);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I'm having problems installing the last SDK for V6.00 that I downloaded at:http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm[^]
It seems to get started then IExplore hangs and gives error message. The SDK update runs from a browser as the update is written JAVA SCRIPT.
I could go through the java script and try to figure out where it hangs, there is tons of JAVA code in the install and it would take for ever.
It's probobly a setting in my browser?
Has anybody had this problem or can you give me some ideas on what to try?
Thanks
|
|
|
|
|
Hi, I have a View Class derived from CView, in which I build a Graph. I wanted to be able to rebuild the Graph based on changes in parameters or something. I would have to delete that View window I am assuming before I do a "RebuildGraphPage". How can I delete the windo? Any idea?
I did try Getting Active View window and deleting it, but it caused a crash.
Thanks for any feedback.
|
|
|
|
|
sabdalla80 wrote: How can I delete the windo? Any idea?
Do you mean erasing the background?
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
[My articles]
|
|
|
|
|
Thanks..I got it to work..All I needed actually was to delete the Class object first which is a Graph in this case.
Thanks
|
|
|
|
|
I want to know any builtin function for highlighting a given keyword in HTML file.
Only the text outside of tags, comments, script code should be highlighted.
I think this could be done by :
Finding out the position of keyword which is a normal text
Replace it with </FONT> keyword </FONT>
Write the new content into the HTML file
Is there any standard method for doing the same?
Any suggestion would be greatly appreciable!!
--
"Programming is an art that fights back!"
|
|
|
|
|
You should look at HTML DOM Parser.
Some interface and methods that may help you are
IHTMLDocument<br />
IHTMLElement2::getElementsByTagName<br />
IHTMLDocument2::createElement<br />
IHTMLDOMNode::replaceChild<br />
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Is there a way to create a class that can be instantiated with different method names? For example, I would like to have an unnamed method in class foo, that can be renamed at compile time using template parameters (or some other method). I envision the class definition as follows:
template<const char* const MethodName>
class foo {
public:
double (MethodName)() {
return 0;
}
}; And it would be instantiated/used in the following way
foo<"asdf"> fooWithMethodASDF;
foo<"mnbv"> fooWithMethodMNBV;
double a = fooWithMethodASDF.asdf();
double m = fooWithMethodMNBV.mnbv(); The purpose behind attempting to do this is because I have two classes, both with three members of type double that have different names, and all other code is identical. Perhaps I could use properties with get/set methods in two different classes that inherit the public interface from the base class, but I am wondering if there is another way to implement this functionality? Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Skippums wrote: Is there a way to create a class that can be instantiated with different method names?
In some way I interpret this as you have a desire to use types as variables, which suggests that you should probably re-evaluate you design.
Even if you were able to do what you want, I don't see the benefit other than adding to the confusion.
Skippums wrote: The purpose behind attempting to do this is because I have two classes, both with three members of type double that have different names, and all other code is identical.
This sound like a very good opportunity to use inheritance and polymorphism.
Perhaps you disagree depending on how you're using the data, but then you may need a container instead and could probably use the std::vector template (or a similar container) combined with std::for_each from the STL library.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|