|
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~
|
|
|
|
|
Hi,
I'm using one of the classes found elsewhere in codeproject to implement my own server. The question is very simple:
How do I get the ip of my server?
In other words, I want to tell a remote client what my ip is, so that they can
connect.
I browsed through the winsock2 api and tried gethostname() and gethostbyname(), but they don't seem to give me what I want.
thanks in advance
|
|
|
|
|
try this, it's not perfect
1) get your host name gethostname()
2) then call gethostbyname() to resolve your host name
you get a host table back, and the first one should be what you want.
|
|
|
|
|
I'm sorry, I've already tried this.
It returns a string which include the "name" of the computer,
but not the ip address (ie. something like "205.212.12.35")
|
|
|
|
|
let me write that in code, maybe you'll see it this way:
// step 1: get my host name:
char hostName[128];
gethostname( hostName, sizeof(hostName) );
// step 2: convert my host name to an address table
const hostent *pHostRecord = gethostbyname( hostName );
// step 3: grab the first address out of the table.
DWORD ip = *(DWORD *)pHostRecord->h_addr_list[0];
it's not a perfect answer, and get's weird when your machine has more than one IP address (multiple NICs). But in general, this works great.
use "inetntoa()" to convert the DWORD ip to a dotted IP string.
|
|
|
|
|
Thanks Peter,
I have been trying to get the ip from the hostent structure all
along, but I didn't use the DWORD cast you did. I assumed it
was already in the form of a string.
But the code that did it in the end is this:
<br />
char strHostname[128];<br />
gethostname(strHostname, sizeof(strHostname));<br />
hostent *pHostent = gethostbyname(strHostname);<br />
ULONG ip = *(ULONG *)pHostent->h_addr;<br />
in_addr ipaddr;<br />
ipaddr.S_un.S_addr = ip;<br />
m_strServerIP = inet_ntoa(ipaddr);<br />
|
|
|
|
|
I'm quite new to programming and need some help. How do I create a 2 dimensional array when I don't know the size of either axis before compiling? I've used Carray quite nicely before for a 1 dimensional array but I can't fiqure out how to do a 2 dimensional array. I also need the array to adjust its size as new data is added. What I really want is to set up a matrix to access some data with dates on one axis and some int number of the other axis. I don't know anything about CMap, but could this work? If so, how would I set up a CMap?
Thanks in advance.
E
|
|
|
|
|
One solution is a vector.
typedef std::vector<> vec?0;
typedef std::vector<<vec?0>> vec?1;
vec?1 data;
...
Kuphryn
|
|
|
|
|
|
I haven't done a multi-dimenstional array yet. So Its been only a CArray. Can I do a CArray of CArrays? How would I define that?
|
|
|
|
|