|
Hi,
I've created a win32 app, and it runs perfectly till i've added #include <shellapi.h> for using the systemtray icons.
The trouble is in CreateWindow, now it returns NULL.
I put the include in myapp.cpp and nothing, and I've put it in stdafx.h, neither.
However, if I don't use Shell_NotifyIcon, so I don't need this header, CreateWindow returns a valid value.
What am I doing wrong?
Thanks.
|
|
|
|
|
Hi,
Our app calls an instance of Word. A custom Toolbar in Word contains a button "Back to App", which will close the word instance and, on Win NT, returns to the app. In Xp however this is not the case. The focus is not necessarely set back to our app.
Can anyone give me a hint how to set the input focus from where it came.
I'm searching in the direction of SetActiveWindow/SetForegroundWindow. (correct?)
tnx for your help.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
On XP and an application cannot set itself as the active app, however another app can. So using SetForegroundWindow( YourApp ) from Word should work correctly. I had a similar problem to this 3-4 weeks back. Do a search here on SetForegroundWindow() and you will find that thread and the respones I got.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
tnx a lot, I'll have a look into it, let's hope I do not have such problems as you had .
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
|
Hi there
I am receiving asynch serial data successfully using a thread.
But I noticed that the time the data arrives is never the same. It actually arrives at say time (y), then at Time (y+1), (y+2)... until (y+10). Then it jumps back to time (y). The transmission time is accurate always at 100ms intervals.
Can anyone maybe tell me why this is the case AND what I should look for to correct it. Maybe a setting somewhere.
Thanks
|
|
|
|
|
Most probably the directory location. Is the file you are reading in the same directory as your app ? Are you loading "myfile.dat" or "L:\Mypath\myfile.dat" ?
When loading manually, the current directory must be your app directory, so it can find the file. Otherwise it is the different programm directory, where your data file is not found.
~RaGE();
|
|
|
|
|
Well the file in in the same dir,
But if I start this program with a diffrent program I don't find the file and if I debug the program I find the file but it don't connect to the network. But if I start the program manoly it works greate.
|
|
|
|
|
What are the error codes/messages you get when the file fails to open?
"An expert is a person who has made all the mistakes that can be made in a very narrow field." - Neils Bohr
|
|
|
|
|
You are most likely being plagued by absolute vs. relative paths. To verify, specify an absolute path in the program.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have a program that read in a file and if a start the program from a diffrent program it don't work but if I start the program manuly it works! What is the problem?.
|
|
|
|
|
Using VC++6
I am reading a value stored in a text field as follows:
First/Last
Want to change it to (reverse the "/"):
First\Last
and store it back
Any help will be greatly appreciated
|
|
|
|
|
CString str="First/Last";
str.Replace("/","\\");
~RaGE();
|
|
|
|
|
If you use MFC CString, you can use CString::Replace().
e.g.
CString strValue("First/Last");
strValue.Replace("/", "\\"); //this will replace "/" with single backslash "\"
Hope this is help
Cheers...
|
|
|
|
|
Hi all,
I need a dirlistbox and a drivelistbox in visual c++ dialog or some thing like that, so that user can show a dialog box and chose a directory path from my dialog.
Tell me what to do ?
thanks in advance.
|
|
|
|
|
The following code will enumerate all the files in the current directory.
CFileFind finder;
BOOL bWorking = finder.FindFile("*.*");
while (bWorking)
{
bWorking = finder.FindNextFile();
myListBox.AddString(finder.GetFileName())
}
or
Use the method CListBox::Dir
|
|
|
|
|
Wouldn't using SHBrowseForFolder() be easier?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I write a program that call more than 1 log function and it give me this error message
"error C2668: 'log' : ambiguous call to overloaded function"
What can I do to resolve this problem??
Thanks in advance.
Best regards,
Pop
|
|
|
|
|
Cast the parameters so they exactly match one of the function definitions.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi there,
I am creating a program that allows me to create the PDF file without using the Distiller. I am stuck in embedding the font. I have tried to use CDC::GetFontData() to read the font data. But still doesn't work.
From PDF documentation, I must include the following tables:
- head - hhea
- loca - maxp
- cvt_ - prep
- glyf - hmtx
- fpgm - cmap
Currently, I used GetFontData() to get the font data and write the BYTE into the file.
Below is the function that I wrote to get the font data:
BYTE * GetFontDataByte(const CDC *pDC, DWORD dwTableName, DWORD & dwSize)
{
dwSize = pDC->GetFontData(dwTableName, 0, 0, 0); //get the buffer size
if(dwSize == -1) return NULL;
BYTE *lpData = new BYTE[dwSize];
if(pDC->GetFontData(dwTableName, 0, lpData, dwSize) == -1) //get the actual font data
{
dwSize = -1;
delete [] lpData;
return NULL;
}
return lpData;
}
Please note: the *pDC contains the selected font. (e.g. pDC->SelectObject(selectedFont);)
Once I got that byte (byte data), I write that byte into PDF Stream. The problem is that everytime I open the PDF file that I created (with embedded font), it always display "Unable to extract the embedded font ..." error message.
Can anyone please help me? I am pretty new with all of this stuff.
Thank you very much in advance.
Ryu Thomas
|
|
|
|
|
Hi to all MASTERs,
Can you please help me out with this problem? I have tried to find the answer through the Internet for past 4 weeks. I am very desperately needed the answer ASAP.
Please help me...
|
|
|
|
|
Do not worry about it anymore. I have solved the problem.
Samin Thomas
|
|
|
|
|
Hai Frens. . .
I need a help...In my application i have to provide a miltiple selection of rows in grid while the Ctrl key is kept pressed. How do i do this.
Can any one guide me. . .
Thanx
|
|
|
|
|
what grid ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Microsoft Flex grid . . .
Can U guide me please
Thanx
|
|
|
|