|
You need to download the latest SDK release. Go to [^] to download it.
I just checked Ryan's answer and he is suggesting the same thing.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Thanx Ryan / Tony,
I am using VC 6. Is it ok if I install PSDK from the link u sent me.
Abhi
|
|
|
|
|
You are welcome.
Abhi@Work wrote:
Is it ok if I install PSDK from the link u sent me
Yes it is ok. I have VC6 and I installed the exact same SDK release a few weeks ago.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Toni!!
I`ve downloaded the SDK but the error still remains.Is there something more to it ?
Abhi
|
|
|
|
|
Abhi@Work wrote:
I`ve downloaded the SDK but the error still remains.Is there something more to it ?
Did you register SDK with visual studio?
If not go to Start->Programs->Microsoft Plaftorm SDK February 2003->Visual Studio Registration->Register PSDK ...
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Ya it worked !! Thanx..
|
|
|
|
|
I customized CColorDialog into MyColorDialog and added a hex edit box. When the user edits the hex box, I need to call CColorDialog::SetCurrentColor, but it seems to crash everytime I do so. Anyone else have any problems with SetCurrentColor?
Thanks.
|
|
|
|
|
Hello all
I would like to know if there's any way of terminating a process from another process without using "TerminateProcess()". I read from msdn that "ExitProcess()" is the best way of terminating a process, But I'm not getting how to use it from another process.
If anyone knows how to do it, pls help me.
Thanks for your help.
Hari.
|
|
|
|
|
ExitProcess() will exit the process that it is called from - it cannot be used to close another process. If the process you are trying to terminate has a main window, then you can try posting WM_CLOSE or WM_QUIT to it, forcing it to close itself.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Hi,
If I have a class
class dll_class
{
func1();
func2();
func3();
private:
int f1;
int f2;
int f3;
};
Then is this permissible?
class dll_class
{
__declspec(dllexport) func1();
__declspec(dllexport) func2();
func3(); /* func3() not exported */
private:
int f1;
int f2;
int f3;
};
i.e. Can I export only some of the functions in the class or do I have to export
all the function in the class? Would instances of the class above cause any run
time errors?
Is it allowable to have a set of multiple classes and carve those into one dll,
and just export the functions that I need from the various classes or should I create
a new class which wraps the functions that I need and just export all the functions in that class?
|
|
|
|
|
Yesterday I read some articles about DLL
I think It is permissable,
But I am not very familar with DLL
I also want to learn more knowledge about DLL.
You can find some articles in this site.
|
|
|
|
|
Simple answer, yes it is possible to export only some functions from a class in a DLL.
You would get linker errors rather than runtime ones.
BUT!!!!
I can't think of a good reason why you would. You are just making your life, and the job of any
users of your DLL harder. Not only do you now have protected / public members, you now have
exported / non-exported member too.
If you *really* want to keep your implementation details a secret, then look at COM / a COM-like
model, where you publish a pure virtual class, implement a Create-My-Class function which returns
a pointer to an instance of a class which implements the virtual functions.
In answer to your second question, you can also export multiple classes / functions from a DLL.
After all, MFC does...
Iain.
|
|
|
|
|
Hi,
I have a simple relatively empty sdi app generated from class wizard.
I can run it and then quit but on exit it crashes and gives.
"Debug Assertion failed", dbgheap.c Expression: pHead->nBlockUse == nBLockUse.
The only thing the program does is load 4 dlls ,
make an instance of one of them unload them and exit.
However each of the 4 dlls relies on loading one of the other dlls.
How do I track this problem down? ( I have source for all dlls )
Yes, I am using the correct dll type for debug, release multithreading etc.
DOes this mean I definately have a memory leak in one of the dlls?
|
|
|
|
|
pHead is NULL that's why you get that error. Is pHead initialized properly? Did you write that part of the code?
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
pHead is part of the MFC heap allocation code. (dbgheap.c)
I assume Im trashing it somewhere but can't isolate the possible memory leaks in the dlls.
|
|
|
|
|
The error occurs in one of these two functions; _free_dbg() and _msize_dbg(). I can't tell you much, you have to debug the program and find out the places where are you deleting pointers that you are not supposed to. If you want to find out where you have memory leaks, after you run the program in debug mode, at the output screen scroll down the end. If you have any memory leaks it will tell you where they are occuring. It seems to me like the heap is getting corrupted, but I don't know why.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
If you get this debug assert, than usually you did something wrong with memory you allocated.
Maybe you freed a block of memory twice or similar.
Jens
|
|
|
|
|
the main funtion includes parameters. how can i run the program in VC++?
|
|
|
|
|
if you mean you are running it in the Visual C++ IDE, eg with F5 or single stepping with F10/F11, you go 'Project' -> 'Settings', select the 'Debug' tab, and enter the arguments to the program in the 'Program arguments :' box...
HTH
|
|
|
|
|
thank you very much! i just need it.
|
|
|
|
|
This may seem like a weird question but here goes. Is there a way to tokenize a tokenized string? Explanation:
I have an input buffer that I am tokenizing line by line. Once I get that line I need to tokenize it 3 times to get the info on it and then go back to the original buffer and get the next line. This is what I have so far but it only tokenizes the first line of the buffer:
//This gets the first line of the buffer
char *temp_tok = strtok(m_readBuffer, "\r\n");
m_ctrlTextInA.SetWindowText(temp_tok);
******************************************
//this tokenizes the whole line
char* tokA = strtok(NULL, ",");
m_ctrlTextInA.SetWindowText(tokA);
char* tokB = strtok(NULL, ",");
m_ctrlTextInB.SetWindowText(tokB);
char* tokC = strtok(NULL, "\r\n");
m_ctrlTextInC.SetWindowText(tokC);
*****************************************
I know I need some kind of loop around the ****, but I can not figure out the parameters of that loop. once i get those 3 tokens i want to get the next line from the readbuffer and continue doing this until the readbuffer is empty
any suggestions???
|
|
|
|
|
Before you tokenize each line, use strdup to create a copy of the line and then tokenize that. strtok() doesn't work properly when you are performing nested tokenizes. You can try passing multiple characters as separater characters to strtok() , but it might be easier to duplicate the string (and free() it when you're finished).
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
help!! I'm confused...
I want to modify my VC++ application so that I can handle environment variables as such:
1) to launch my application (e.g. %MY_VAR%\bin\myapp.exe
2) as arguments to my app (e.g. %MY_VAR%\bin\myapp.exe %MY_VAR%\config\setup.dat
3) other processes launched "as threads" recognize %MY_VAR%
I have made some coding changes in my app's InitInstance() function to immediately resolve the environment variable. I do this like:
CWinApp *app = AfxGetApp();
if ((app->m_lpCmdLine, '%') != NULL)
{
// ExpandEnvironmentStrings(...), but I wrote my own
ResolveEnvVars(app->m_lpCmdLine); // resolves string in place
}
if (strchr(__targv[1], '%') != NULL)
{
ResolveEnvVars(__targv[1]);
}
// Parse command line for standard shell commands,DDE,file open -- WIZARD
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
PROBLEM -- I am having problems getting it to work, having problems using the DEBUGGER.
If I try to use the debugger while in STUDIO, it doesn't like me to supply %MY_VAR% in the arguments list. Is there a way to use %MY_VAR% format in the edit fields of the DEBUG Settings page???
Please help (aleviate my confusion).
Thanks.
Johnny
|
|
|
|
|
I can't find a way to hide the list view inside of the file open dialog. I can hide all of the controls except for that one. Does anybody know how to do it?
I've derived a class from CFileDialog, and in OnInitDialog I try to hide controls:
GetParent()->GetDlgItem(edt1)->ShowWindow(SW_HIDE);
GetParent()->GetDlgItem(lst1)->ShowWindow(SW_HIDE);
What's funny is that I can resize the list box using GetParent()->GetDlgItem(lst1).
What's even funnier is if I try to show the list control, it disappears:
GetParent()->GetDlgItem(lst1)->ShowWindow(SW_SHOW);
Thanks for helping.
Dave
|
|
|
|
|
My wife has asked me to write an app that will call her cell phone and when she picks up, "speak" a prerecorded message into it. It would be nice to detect if I get her voice mail, so I can press # and then leave the same message there.
I'm not sure how to do this. I've already prepared the message into several MP3 files on my computer. I can use C++ or C# (preferrably), but I don't know what libraries to use for making the phone conversation happen. It would also be nice if I could somehow make the call through an Internet connection, but if that's too complex, I'll settle for dialing out through my modem.
I appreciate any guidance.
Regards,
Alvaro
If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
|
|
|
|