|
Hello to all,
i am having a character pointer which points to a character string, lets say it is "char* A", this 'A' points to a character string lets say "Hello codeproject forum", now i want to break this string into single characters so that i can display this string character by character on a page as i am having space limitations means rather than displaying the string "Hello codeproject forum" on one line i want to display it like below-
Helloco
deproje
ctforum
how this can be done? can anybody tell me plz? its urgent.
Thanks and Regards,
Anay
|
|
|
|
|
The pointer is basically a pointer to an array of chars.
You can simply loop through them one by one and print 7 chars, then print a new line.
char* a = some_string;<br />
int length = strlen(a);<br />
while(length > 0)<br />
{<br />
for (int i = 0; i < 7; i++)<br />
{<br />
length--;<br />
cout << *a++;<br />
}<br />
cout << endl;<br />
}
|
|
|
|
|
sounds weird. but i am wanting to create a virus to corrupt all the data on my computer when i run it. kinda like those erase programs but they take too long. i want to corrupt so it will be much quicker i just want to be able to make my stuff unreadable. i don't know much about this stuff. but i do have some programming knowledge in C++ and VB.NET. if anyone has any links or suggestions please let me know. thanks
|
|
|
|
|
I cant understand why you want to corrupt datas on your system?
|
|
|
|
|
for security reasons. just like those programs that erase your hard drive. except that takes too long. if doing this would be faster. that would be great.
|
|
|
|
|
I think you have other choices instead delete files.
|
|
|
|
|
I want to make a program that queries google and wikipedia with a user defined string and displays their results. To do this I'll need to search through the received xhtml source. How do I go about this?
Do I need to set up an IIS or ATL server?
Does anyone have tips, such as headers/methods I'll need to use?
Any advice is greatly appreciated!
|
|
|
|
|
|
I want the child Window created in MDI application to move out the main frame window.
Main frame is the parent of child frame, so it is always stays inside of the main frame.
Is it possible by any means, so that I can move child frame out of mainframe.
Your response will be highly appreciated.
Thank you,
|
|
|
|
|
|
HI
I works now. I got the problem.
Thank you.
[SOLVED]
I am trying to add a status bar and toolbar with the Childframe of MDI application.
1. I have added a CToolBar member in CChildFrame class which is derived from CMDIChildWnd
2. Add a message handler for WM_CREATE in CChildFrame class
3. Try to use m_toolbar.Create() method of toolbar to create the toolbar in OnCreate() method of CChildFrame \
But I got assertion.
Is it possible to add status bar or toolbar in Child frame of MDI applicaton.
Please help me if you know how it can be done.
Thank you.
-- modified at 19:15 Friday 19th October, 2007
|
|
|
|
|
VS 2005
VC++
Hello,
Is it possible to copy all contents in string table and paste in MS excel? If it is possible, then how?
I appreciate your reply.
Thanks,
Muthiah.
|
|
|
|
|
You cant but you can read each line of string table on your code with CString::LoadString and then write to excel.
|
|
|
|
|
When running my .exe, which is dialog based, I receive an abort message and it won't let me debug the program. It just basically leads me to exit the program. I receive a location of 0x008a56a9 and when I click on the error dialog box, it leads me to wincore.cpp at the following function and location:
[pre]BOOL CWnd::Attach(HWND hWndNew)
{
ASSERT(m_hWnd == NULL); // only attach once, detach on destroy
ASSERT(FromHandlePermanent(hWndNew) == NULL);
[/pre]
Can someone lead me in a good direction to see where this program is really crashing?
Thanks.
John P.
|
|
|
|
|
Can you more explain about your project?
|
|
|
|
|
I'm going to create a program that does a search in a list control. I want that the user types the keyword in the search box and the program selects the appropriate column.
It's an MFC Dialog based program, i use MS VC++ 2005 and i am not an very experienced programmer.
I just need to know what does select an item/column in the list.
Thanks in advance!
|
|
|
|
|
See documents for GetItem for each item on the list we have image,text,state and lparam but GetItem returns only an item at a time so you can use of a loop for search list
you can set mask = LVIF_TEXT; and on the loop search list.
|
|
|
|
|
I need to store an image(like a company logo) on the printer permanent memory and the need to print it on a paper at desired location whenever required (using postscript printer language). How can I save an image on the printer? Using command line, printer driver, anything... I'm completely frustrated browsing the web for this. Does anyone knows anything about this? I know this is not a C++ question but I am sure you smart guys know about this. Please help me. Please point me to some link or ant sample code.. something...at all.
|
|
|
|
|
Unhandled Exception: System.Net.Sockets.SocketException: No connection could be
made because the target machine actively refused it
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at AsyncServer.InitSocks()
i get this message after compilation of the code in the console window.Does anyone know how to resolve this issue?Thanks
|
|
|
|
|
|
|
if only you were :
1) expressing yourself clearly
2) asking the correct forum (this is Managed C++ or C++/CLI)
3) explaining what you had tried first before expecting too much of us
4) giving full error messages and a related and relevant code
|
|
|
|
|
This is my code which is probably causing the error:
void AsyncServer::InitSocks()
{
String* server = "CATUXPSD01";
int port = 4901;
printf("in InitSocks");
String* request = String::Concat(S"Our test data asdf");
Byte bytesSent[] = Encoding::ASCII->GetBytes(request);
Byte bytesReceived[] = new Byte[256];
Socket* s = 0;
IPHostEntry* hostEntry = 0;
// Get host related information.
hostEntry = Dns::Resolve(server);
// Loop through the AddressList to obtain the supported AddressFamily. This is to avoid
// an exception that occurs when the host IP Address is not compatible with the address family
// (typical in the IPv6 case).
IEnumerator* myEnum = hostEntry->AddressList->GetEnumerator();
while (myEnum->MoveNext())
{
IPAddress* address = __try_cast<ipaddress*>(myEnum->Current);
IPEndPoint* endPoint = new IPEndPoint(address, port);
Socket* tmpS = new Socket(endPoint->AddressFamily, SocketType::Stream, ProtocolType::Tcp);
tmpS->Connect(endPoint);
if (tmpS->Connected)
{
s = tmpS;
break;
}
}
// Create a socket connection with the specified server and port.
if (s == 0) {
printf("Connection failed");
} else {
// Send request to the server.
s->Send(bytesSent, bytesSent->Length, static_cast<socketflags>(0));
}
}
So a socket is being created so I can send data. My problem is that when there is nothing listening on the port I don't want the program to generate the error, I want to trap the error and do something with it.
|
|
|
|
|
but still you're asking a C++/CLI question in the wrong forum...
|
|
|
|
|