|
Due to my low knowledge on API's and due to the fact that adressing public variables is my lifetime goal i need to know how i may adress them.
i tried to pass the this pointer from the main dialog to the tab dialog. this worked well, but the pointer didn't hold any of the functions or variables declared public.
how is it possible then?
|
|
|
|
|
Are you using C++? Is this an MFC app?
|
|
|
|
|
|
In that case it's pretty simple. Just declare a variable in the child dialog. You can declare it public, or create GetXXXX() API. When the child dialog exits (when user clicks ok), the parent can get data from variable.
If you want to send parent immediate notification, send a user defined message when button is clicked. To do this, when child dialog is invoked, be sure to pass pointer to parent (usually pParent - this is usually defined as CWnd *pParent). Then child dialog can send message by pParent->SendMessage(...).
|
|
|
|
|
Ty,
i just learned how to handle messages
works really well.
|
|
|
|
|
|
Hello all,
I have a function like below
int fn_RecognizeWord(TCHAR** strUnicode)
{
string unicodeStr;
.....
//Problem in this line
strcpy(strUnicode[0],unicodeStr.c_str());
}
How can i initialize into 'strUnicode' variable using 'unicodeStr' variable. For example 'unicodeStr' variable contains just a single line of string, like '80653478'.
Thanks to all
|
|
|
|
|
What is the problem ? Did you initialize your strUnicode array properly ? What I mean is, did you create an array of TCHAR* of the correct size, then for each of these pointers allocate the correct number of characters ?
The second step is probably easier to do once you know the size of your string:
strUnicode[0] = new TCHAR[unicodeStr.size()];
strcpy(strUnicode[0],unicodeStr.c_str());
|
|
|
|
|
It is not working. I testing it with MessageBox(), but this statement not working
|
|
|
|
|
What do you mean it's not working ? Could you explain what you are expecting, what do you get and show some code ?
|
|
|
|
|
Actually it gives "Please tell Microsoft about this problem." window when it executes that line
|
|
|
|
|
Shaheen.India wrote: strcpy(strUnicode[0],unicodeStr.c_str());
If the vairable name in your code make sense, I must say that you cannot simply copy the content of a string to a UNICODE pointer. you have to use MultiByteToWideChar() function or mbrtowc() function
|
|
|
|
|
No its just a string like '973465', store into 'unicodeStr'
|
|
|
|
|
|
Hi all,
I've got a strange problem while debugging inside CString code. Everytime I step through my code and the debugger steps into CString stuff, e.g. atlsimpstr.h, it lasts for about 30 seconds to move on to the next line. This is very annoying.
Anyone out there having the same problems or a solution for this?
Regards,
jung-kreidler
|
|
|
|
|
jung-kreidler wrote: Everytime I step through my code and the debugger steps into CString stuff, e.g. atlsimpstr.h,
Does this happends automatically or you do purposefully steps into that function?
jung-kreidler wrote: Anyone out there having the same problems or a solution for this
Try deleting the .ncb file of the project/solution and try again.
|
|
|
|
|
Naveen wrote: jung-kreidler wrote:
Everytime I step through my code and the debugger steps into CString stuff, e.g. atlsimpstr.h,
Does this happends automatically or you do purposefully steps into that function?
jung-kreidler wrote:
Anyone out there having the same problems or a solution for this
Try deleting the .ncb file of the project/solution and try again.
This happens during stepping through the code by pressing F10 and F11.
Deleting the ncb is always the first step, yes, but it did not help.
Thanks
|
|
|
|
|
jung-kreidler wrote: Deleting the ncb is always the first step, yes, but it did not help.
jung-kreidler wrote: This happens during stepping through the code by pressing F10 and F11.
What I was about to say is that, if you dont want to debug inside the CString functions, you specify your debugger not to step in through that functions. Check http://www.cprogramming.com/debugging/visual-studio-msvc-debugging-NoStepInto.html[^] for details.
|
|
|
|
|
That did the trick! I've had to google a bit, but now it steps over it. Here's what I've done with VS2008:
Open:
HKLM\Software\Microsoft\VisualStudio\9.0\NativeDE\StepOver
Create String (obviously a don't care):
Cstring functions
Value:
ATL\:\:.*=NoStepInfo
Thanks for your help!
|
|
|
|
|
Dear all,
I used the function in this link Wildcard string compare (globbing)[^]
To compare two strings the first is Pattern("* KK *") and the second is Text("TT KK ZZ") and the function return pass. thats briliant,but my question how I can edit the function to be able to catch or handle the characters of matched * to save them in variables. for example: when the matching occured I need to save the following characters into strings variable like :-
X ="TT"
Y = "ZZ"
to deal with them later on in my system.
I tried many times but its not working well so far.
So please any one have an idea to do that please let me know and any help will be appreciated.
Best Regards.
|
|
|
|
|
Hey, wondering if anyone knows what's going on here If i define my class as below when the memset() function runs there is an access violation. However if I define NOTIFYICONDATA locally on the stack it works fine.
.h
#pragma once
class CTrayIcon
{
public:
CTrayIcon(void);
virtual ~CTrayIcon(void);
void OnCreate(HWND parent, UINT uCallbackMessage, HICON icon = NULL);
protected:
NOTIFYICONDATA m_nidSystrayIcon;
};
.cpp
void CTrayIcon::OnCreate(HWND parent, UINT uCallbackMessage, HICON icon)
{
m_hParentWnd = parent;
m_hIcon = icon;
m_uCallbackMessage = uCallbackMessage;
memset(&m_nidSystrayIcon, 0, sizeof(m_nidSystrayIcon));
m_nidSystrayIcon.cbSize = sizeof(NOTIFYICONDATA);
m_nidSystrayIcon.hIcon = m_hIcon;
m_nidSystrayIcon.hWnd = m_hParentWnd;
m_nidSystrayIcon.dwInfoFlags = NIIF_NONE;
m_nidSystrayIcon.dwState = NIS_SHAREDICON;
m_nidSystrayIcon.uVersion = NOTIFYICON_VERSION;
m_nidSystrayIcon.uCallbackMessage = m_uCallbackMessage;
Shell_NotifyIcon(NIM_SETVERSION, &m_nidSystrayIcon);
}
Is there some special initalization that I am missing? I downloaded an example app and there doesn seem to be anything that I am missing, but obviously there is something wrong. Any ideas?
Nicola.
|
|
|
|
|
Hi,
I want to know that can i store output from readdir() function in an array. I have a c program
#include <dirent.h>
#include <stdio.h>
int main(void)
{
DIR *d;
struct dirent *dir;
d=opendir("C:\\");
printf("Directories in C:\\ \n");
while((dir=readdir(d))!=NULL)
{
printf("%s\n",dir->d_name);
}
closedir(d);
return(0);
}
Instead of printing directories in output i want to store that result in an array.can it is possible?
|
|
|
|
|
Replace the printf statement with code that fills up a string array?
Do you have a problem doing that?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
hey Rajesh R Subramanian,
i tried this thing also but i was not working properly. can you please give the correct code?
|
|
|
|
|
I'm curious if anyone uses the macros defined in sal.h (__in, __out, etc.)?
|
|
|
|