|
Moak wrote:
At this point, when you work object orientated
I wish my server could be 100 % C++ but it's not!
I use many globals and many functions. As for now... I only has 2 classes for handling two log books.
But this is just a test server.. pretty big to be a test server but what the heck!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Hi:
As you know EditBoxes have its own ContexMenu that apper when you right
click on them,now is it possible to add some items to this menu ? for example i think it is nice to be able to add "Help..." or "About..." items to it.please help me.
Excuse me for bad comments.
Best Regards.
|
|
|
|
|
|
For some time now, I've been writing components for performing various operations all without presenting a user interface, and letting VB do the UI stuff for me.
I've now got to the point, where it's just getting to damn hard to keep track of all the threads my components create and synchronising them back to VB.
I'd like to move my App to VC/MFC (vc6), and do away with the components as such, but I'm just unsure about how to progress.
I've basically built an app which has 8 concurrent(worker threads afaik), that presents various stages of progress for a configuration application
1 parent window with 8 vb frame windows inside it. How do I do this in MFC.. I really don't like the idea of throwing up 8 individual windows.
Please help, I know this sounds pretty lame, but I'm ready to take the next step regarding my application development.
|
|
|
|
|
Hi!
I am writting a program which has several threads and each thread must run only on one CPU.
My questions are:
1. SetThreadAffinityMask can only thread on those CPU which its process is allowed to run, Can I use this code
SetProcessAffinityMask(GetCurrentProcess(),0xFFFF);
to access all the CPUs(Note: that the affinitiy mask is 1 for all CPUs). Does this code run on all systems without error even on single processor systems?
2. Can I use
SetThreadAffinityMask(GetCurrentThread(),3);
to run the thread on both CPU0 & CPU1? or does it give the choice for thread to run on any of them? or should I set only one vector bit to high?
It is a bit confusing for me , anyone can elaborate on this topic? It can be very useful since many new systems are comping with HT or mulitprocessor.
Thanks!
Rob
|
|
|
|
|
I've got VC++ .NET solution with more than 3 projects. I'd like to add another (proved as working) project, which mainly producing strings (stimulated by an external hardware equipment connected to com1). Let's call the added hardware project as "Har" and to existing DLG project to whom I'd like to transfer the strings as "MDlg".
My problem is to "transfer" generated strings from Har to MDlg in the solution scope. In the project scope I have no problem to do that by:
1) Declare in one cpp file a string variable and declare it in other cpp files as extern, works - no problem.
2) Define base class with static string variable and inherit other relevant cpp files from this base class, works - no problem.
Problem is that above 2 technics aren't working in the solution scope and generating link errors .
How can I solve the problem (please don't suggest me to incorporate Har into MDlg, not in my lifetime )
|
|
|
|
|
|
I have a com dll written in C++ which is used in asp applications. The dll contains only one com object. There are static (global to the process) data objects within this dll. Obviously, I only want to initialize these static objects when the dll is first loaded.
However, IIS seems to be reloading my dll everytime the com object is created and used in an asp page.
P.S. Already tried the trick of returning S_FALSE in DllCanUnloadNow, doesn't really work. For VB6 com dll, you can set a project property "Retained in memory" which is exactly what I need. Don't know if the same can be done with VC++ com dll.
|
|
|
|
|
Anonymously wrote:
I have a com dll written in C++ which is used in asp applications. The dll contains only one com object. There are static (global to the process) data objects within this dll. Obviously, I only want to initialize these static objects when the dll is first loaded.
However, IIS seems to be reloading my dll everytime the com object is created and used in an asp page.
Try running it inside a COM+ application or MTS package: create a new COM+ Application, drag and drop the dll inside it and in the properties configure the application to never shut down.
It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)
|
|
|
|
|
Sorry, COM+ is not allowed for this specific project.
I am just wondering what is exactly the "retained in memory" property of VB6 com dll and why there is no such thing for VC++ com dll.
|
|
|
|
|
This is not a real programming question.
The dialog editor has gone weird and I don't know how to fix it.
The Dialog seems to be a bit too much up left and if I do anything like pull the dialog bottom down everything just disappears. I added a screenshoot here:
http://www.informatik.uni-freiburg.de/~dornhege/ResWeird.gif
So atm I have to set the dialog in the textfile which is not really good
I can't remember changing anything and this applies not to one specific project but to all
Any hints besides reinstall ?
|
|
|
|
|
/*why is it that when i call my msgbox sub-rtn sometimes it will appear behind my dos window and sometimes infront?
here is how i call msgbox.
Libraries used (if related, i don't know; it compiles fine and despite the msgbox problem works fine): stdio.h,stdlib.h,string.h,math.h,conio.h,windows.h,tchar.h
*/
<br />
<br />
HHOOK hMsgBoxHook;<br />
void MsgBoxEnc(void);<br />
LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam);<br />
int MsgBoxEx(HWND hwnd, TCHAR *szText, TCHAR *szCaption, UINT uType);<br />
<br />
void main(void){
printf("the stuff printed in my program");<br />
MsgBoxEnc();<br />
MsgBoxEnc();<br />
}
<br />
LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam)<br />
{<br />
TCHAR ach[40];<br />
HWND hwnd;<br />
HWND hwndButton;<br />
<br />
if(nCode < 0) return CallNextHookEx(hMsgBoxHook, nCode, wParam, lParam);<br />
switch(nCode){<br />
case HCBT_ACTIVATE:<br />
hwnd = (HWND)wParam;<br />
SetWindowText(hwnd, _T("Message from Creator"));<br />
hwndButton = GetDlgItem(hwnd, IDOK);<br />
SetWindowText(hwndButton, _T("OK"));<br />
return 0;<br />
}<br />
return CallNextHookEx(hMsgBoxHook, nCode, wParam, lParam);<br />
}<br />
<br />
int MsgBoxEx(HWND hwnd, TCHAR *szText, TCHAR *szCaption, UINT uType)<br />
{<br />
int retval;<br />
hMsgBoxHook = SetWindowsHookEx(<br />
WH_CBT,<br />
CBTProc,<br />
NULL,<br />
GetCurrentThreadId() );<br />
<br />
retval = MessageBox(hwnd, szText, szCaption, uType);<br />
UnhookWindowsHookEx(hMsgBoxHook);<br />
return retval;<br />
}<br />
<br />
void MsgBoxEnc(void){<br />
TCHAR szContents[] = _T("File Encoding is now Complete");<br />
TCHAR szTitle[] = _T("File Status");<br />
MsgBoxEx(NULL, szContents, szTitle, MB_OK | MB_ICONEXCLAMATION);<br />
}<br />
/*In my full program i call the function twice in some sub-rtn and the first time the msgbox will appear behind the dos window; second time, in front!? souldn't the same thing happen both times (which would be worse, i want the box to always be infront)??
Also please remember that i kind of have no idea what's going on(i've never used the windows functions in my programming class, gota love 1st yr Engineering). Mostly the problem is i don't understand the different datatypes used here (nor could i find any info on JUST these datatypes on the net); so this is a collaberation of:
code i found on the net,
code i figured out by searching the STD libraries,
and luck.
p.s. if someone could tell me where to learn EXACTLY what happens here, i would be really grateful. thanks for your time.*/
|
|
|
|
|
;PHi, Maximilien. I'm hkbeckham. Could I have your email addres? So, I can send my present program to you.
My email is:
hkbeckham2003@yahoo.com
Cheers
hkbeckham
|
|
|
|
|
I have a formview project with Internet Explorer page which contains checkboxes that allow the user to clear cookies, clear history, clear urls....... I know how to get the value form each checkbox to see if it has been checked, but I need more information on how to actually delete these files. I would appreciate it.
|
|
|
|
|
See
FindFirstUrlCacheEntry
FindNextUrlCacheEntry
DeleteUrlCacheEntry
|
|
|
|
|
Hello,
Anyone know how to attach a bitmap to the disabled state of a bitmapbutton ??
For now I do:
((CButton*)GetDlgItem(IDC_BUTTON1))->SetBitmap((HBITMAP)m_dsUp);
When it don't worked when the button is grayed.
|
|
|
|
|
From MSDN...
To include a bitmap-button control in a dialog box
1. Create one to four bitmap images for the button.
2. Create a dialog template with an owner-draw button positioned where you want the bitmap button. The size of the button in the template does not matter.
3. Set the button's caption to a value such as "MYIMAGE" and define a symbol for the button such as IDC_MYIMAGE.
4. In your application's resource script, give each of the images created for the button an ID constructed by appending one of the letters "U," "D," "F," or "X" (for up, down, focused, and disabled) to the string used for the button caption in step 3. For the button caption "MYIMAGE," for example, the IDs would be "MYIMAGEU," "MYIMAGED," "MYIMAGEF," and "MYIMAGEX." You must specify the ID of your bitmaps within double quotes. Otherwise the resource editor will assign an integer to the resource and MFC will fail when loading the image.
5. In your application's dialog class (derived from CDialog), add a CBitmapButton member object.
6. In the CDialog object's OnInitDialog routine, call the CBitmapButton object's AutoLoad function, using as parameters the button's control ID and the CDialog object's this pointer.
End MSDN...
Art
|
|
|
|
|
I try all the methods which I can find to create a vertical CTabCtrl,but I failed to crack it!!
I search entirly the MSDN,it seems that someone only can create a top style or bottom style's CTabCtrl,have no method to create a vertical CTabCtrl!
what can I do?
|
|
|
|
|
Check the "Vertical" box in the control's "Styles" tab in the resource editor. "Top" is akin to "Left" and "Bottom" to "Right" when using a vertical tab control.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
thank you!
but I have the new problem,I find It is very dificult to use TCS_OWNERDRAWFIXED style to rewrite a vertical CTabCtrl!
|
|
|
|
|
I want to implement some sort of a "syntax highlighting" preview area in a program I'm writing, kind of like the one available in Macromedia Dreamweaver MX or other similar programs. So, I'd like some sort of edit control with various sample text fields and, as I change the color settings, I want this preview to display the color changes.
What is the best way to implement this kind of feature? Is using some sort of an HTML view (or control) the best idea? Or perhaps a CRichEditCtrl? Anyone know of any open source projects (preferably in C++) that include this sort of feature?
Any pointers would be greatly appreciated!
Jonah Bishop
Visit JGB Productions
|
|
|
|
|
See these articles:/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
These are some cool articles that you've pointed me to, but here is a screenshot of something more along the lines of what I want:
http://www4.ncsu.edu/~jgbishop/images/misc/SyntaxPreview.jpg
This comes from the Open Perl IDE (a great little perl IDE BTW). Maybe I'm just missing an obvious point, but the articles that you've listed seem to be more for the syntax highlighting in an editor. I just want a preview of what colors will look like together...
Thanks!
Jonah Bishop
Visit JGB Productions
|
|
|
|
|
I really need your help guys because I am new to C++ and I don't understand many things.
I want to make a program that reads text files, tokenize the text and print the word frequency (how many same tokens exist in a file).
I have already started the program but now I got stuck.
I have this function which counts the frequency of a word in a file ("out.txt").This file has the tokens, one at each line. (The input text has alreadu been tokenized.) The function is called from main() when I want to count the word occurences of a file. When I call this function again (the file "out.txt" has changed,it has the tokens of the second file) because I want to count the frequency of words in another file, I get the total frequency of words(including the tokens of the previous file)in the file "1.txt".What I do wrong? Is there something happening with the iterator or the const? I really don't know a lot about these things. Here is the functions:
map<string,int> histogram;
void record(const string& s)
{
histogram[s]++;
}
void print(pair<const string,int=""> & r)
{
ofstream fout("eksodos.txt",ios::app);
fout << r.first << ' ' << r.second << '\n';
}
void freq()
{
ifstream fin("out.txt");
istream_iterator<string> ii(fin);
istream_iterator<string> eos;
for_each(ii,eos,record);
for_each(histogram.begin(),histogram.end(),print);
ifstream from("eksodos.txt");
ofstream to("1.txt");
char ch;
while(from.get(ch)) to.put(ch);
ofstream fout("eksodos.txt",ios::trunc);}
Thank you very much in advance
|
|
|
|
|
naja wrote:
ofstream fout("eksodos.txt",ios::app);
fout << r.first << ' ' << r.second << '\n';
Just a guess because I really have never used macros such as for_each, or template classes like istream_iterator, but you don't seem to close your files after you open them. Now that will cause you unpredictable problems.
~Afterall I realized that even my comment lines have bugs~
|
|
|
|
|