|
thanks,
I have been converting a *.c file to c++.
steven
|
|
|
|
|
I`m sorry but is the same in c and c++;););)
|
|
|
|
|
Hi,
I got a question with MFC. I have a Dialog and a Scroll bar. A child window (of the dialog) is created and is a lot bigger than the dialog. I want to scroll the window. Srolling work fine, but it's not smooth, a bifg rectangle at the bottom or the top (depending if you scroll down or up) is redrawing the window (like an InvalidateRect). Check out the code: (in the mouse whell event):
if (zDelta<0)
{
if (m_nScrollPos < nMaxPos)
{
zDelta = min(max(nMaxPos/20,5),nMaxPos-m_nScrollPos);
m_nRecalibrateMouse += zDelta;
m_nScrollPos += zDelta;
m_pcScrollBar->SetScrollPos(m_nScrollPos,TRUE);
// that when I move the CWnd -->
m_pcMainWindows->SetWindowPos(NULL, 0, -m_nScrollPos, m_pcMainWindows->MyGetm_nWidth(),m_pcMainWindows->MyGetm_nHeigth(),SWP_NOZORDER | SWP_NOACTIVATE);
}
}
else ...
Thank for helping !
Charles
|
|
|
|
|
this is the code i used in eVC++, in the Windows CE API in the WinMain function, from grattan's, [i]pocket pc development in the enterprise.[/i]
SHELLEXECUTEINFO sei;
TCHAR tFile[255];
if (lpCmdLine[0]==0) wsprintf(tFile, TEXT("\\ePowerDiagnostic.vb"));
else
wsprintf(tFile, lpCmdLine);
ZeroMemory(&sei, sizeof(sei));
sei.cbSize = sizeof(sei);
sei.lpFile = tFile;
return ShellExecuteEx(&sei);
return 0;
supposedly, since the eVB application (project1.vb, [i]ePowerDiagnostic.vb in my case[/i])is "associated with the pvbload.exe, the ShellExecuteEx will load the pvbload.exe file with the project1.vb as a parameter ( just as if we were tapping the project1.vb file from the start menu or programs folder.
however, i followed the instruction, imported an icon, and compiled by using the relase suffix and building the project. i copied the lauch app to the device. however, the error msg i keep getting on the pocket pc is
" 'ePowerDiagnostic' is not a valid Pocket PC application "
I'm not sure where I went wrong....
thx.
|
|
|
|
|
If I have two processes with normal priority, and each has a thread running with different priorities like this:
Process 1
|- Thread 1 (High Priority)
Process 2
|- Thread 2 (Normal Priority)
I'm trying to work out whether the high priority on the thread affects only the thread's chances of getting a slice within the context of slices available for the process, or whether it affects the allocation of slices at the same level as process priority.
That's not hugely clear, I know. Given this scenario, will Thread 1 get more time on the processor than Thread 2 (even though the processes have equal priority)?
Any ideas? Thanks.
--
Simon Steele
Programmers Notepad - http://www.pnotepad.org/
|
|
|
|
|
I believe a thread priority is relative to the priority of the process it resides in.
Kuphryn
|
|
|
|
|
The Base Priority of a thread is determined by both the process priority class, and the thread priority. It's just two different mechanisms (one to weight processes in the system, one to weight threads inside one process)
Thread 1 will (almost) always get scheduled first when both are waiting for an event or similar.
The scheduler always schedules the thread of the highest priority that is ready to run. So Thread 1 will starve thread 2, if it doesn't give up processor time or a second CPU is available.
The one exception is: Input goes to Thread 2. When input waits in the queue for a thread, it's priority is temporarily boosted.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
(1)I have an array of pixels to be displayed. Does someone know how to do that?
{
....
char* pixelarray = malloc(sizeof(uint32)*width*height);
fill_in_content(pixelarray);
//how to display the pixelarray on the screen now?
}
(2) if I have an linked list data structure to represent the pixel
struct link_list
{
char pixelvalue[4];
link_list* next;
}link_list;
{
...
link_list* head
build_linked_list(head, width*height);
fill_in_content(head, width*height);
//how to display the content in the linked list to screen?
}
|
|
|
|
|
I'm no GDI expert but a pixel has three properties: X coord, Y coord, and RGB value. With these three values, you can render a pixel at a certain location in the desired color.
|
|
|
|
|
Either create it as a bitmap and use bitblt() or, if you really want to paint each pixel... SetPixel().
onwards and upwards...
|
|
|
|
|
SetPixel() will be slow though.
John
|
|
|
|
|
I created a CStatic subclass that handles ON_WM_KEYDOWN and can capture the key presses ok, but when a key is pressed it generates the beeping sound you usually get when a key press isn't being handled. If anyone knows how I can stop this or where I should start looking I'd appreciate it.
(Also if anyone knows how to capture arrowkey events please let me know, none of ON_WM_KEYDOWN, ON_WM_SYSKEYDOWN, or ON_WM_CHAR seem to catch them)
Thanks
|
|
|
|
|
I'd guess that it's the keyboard device driver intercepting the keystroke before passing it on to Windows.
|
|
|
|
|
Hey All,
Just wondering how I'd go about extracting resources from an MFC app i.e. Bitmaps etc.
Regards,
Brian Dela
|
|
|
|
|
Can't you load the EXE in Visual Studio as a file and get at them that way? I've done it with VS.NET, I can't remember if VS 6.0 supports that or not (I think it does.)
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
Navin wrote:
I can't remember if VS 6.0 supports that or not (I think it does.)
Yes it does . It doesn't support re-saving on Win9x/ME though.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
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"
|
|
|
|
|
Should have tried that.
Regards,
Brian Dela
|
|
|
|
|
How to make my app can not be seen from screen?
Any suggestion or direction are highly appreciated.
|
|
|
|
|
Well, you can always create an application that does not have a window. Even if it does has a window, you can always create it as hidden.
|
|
|
|
|
ShowWindow(SW_HIDE)
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
You could write a program using API and not use a window at all. In WinMain you can just do other things. I don't know how safe that is but I have done that once and it worked just fine for me. Well, that program was not for release.
// Afterall, I realized that even my comment lines have bugs
|
|
|
|
|
This is a fairly ambiguous request. Can you provide a small code snippet that shows what you are doing, and what a "stream" is?
|
|
|
|
|
;o)
Thanks, David.
I have solved the problem already.
I pass array of streams in function.
Managed C++ code:
[Serializable]
public __gc class MSGDATA
{
public:
...
MemoryStream * attachStream __gc[];
};
C# code:
MSGDATA pMsgData = new MSGDATA;
pMsgData.attachStream = new MemoryStream[HOW_MANY_ATTACHMENTS];
for (int k=0; k < HOW_MANY_ATTACHMENTS; k++)
{
pMsgData.attachStream[k] = new MemoryStream();
}
SendMail(pMsgData);
|
|
|
|
|
At the first of the stream you could add a header struct:
#define MAX_FILES 20 //Set to what you need.
struct StreamInfo
{
int nNumberOfFiles;
DWORD dwFileSizes[MAX_FILES];
}; When reading the stream the first sizeof(StreamInfo) bytes would be your structure.
Hope this helps...
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
Hi,
Still trying to get familiar with MFC, please bare with me
I have a program set up so that a user can enter information into a edit box/control. I want to take that information and have it go to a list box/control so to form a scrolling list.
Can someone help me do this? I can't seem to figure out how to go about this.
Thanks in advance for all your help.
|
|
|
|