|
i want play a sentences one after other without using getstatus function of direct sound
if anybody has info. plz reply soon
|
|
|
|
|
I have lots of bitmap images collected in a folder. I want to import these images into Resource with their file names. When I import all images,Visual Studio give IDs to them like IDB_BITMAP1,etc. Then I have to change their IDs to names.
How can I make this easier?
Is using file names for the images the best(fastes) way to deal with images?
|
|
|
|
|
use the resourse editor....just load in ur bitmaps and they will directly be assigned a resourse name.....
well the images (resourses) are handles by the resourse id.....so i think itz faster the other way round
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
I don't think there's an "intelligent" way within VS to have the ID reflect the name of the bitmaps; you could do a very simple program that generate IDs based on the file name, and make a text that you could paste into the resource file.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hello !
I would like to know if it is possible to use the interruptions (with the MFC's, win32 application or console application) ? Specially the serial interruptions. If yes, how can they be used ?
Thanks
|
|
|
|
|
No, it not possible with MFC or API. Only you can create your developed driver by Microsoft or any other (OSR) Device Driver Kit (DDK).
|
|
|
|
|
Hi everyone,
I am trying to write a wav file from the audio data buffers (using WAVEHDR). My intention is to write one block of this 'filled' audio data (from an input device) into a wave file.
I have researched on this and know several things about the wave file header, riffs, etc, and I also have searched through codeproject.com and found some sample codes of writing wave file, but they did not provide sufficient explanations (but they are working! *GREAT*).
Thus, if anyone can help me with an introduction of how to write a wave file using the above method I have described earlier, please post-it here. I certainly appreciate it. Or, if you have any url that links to a website with this kind of tutorial, please post-it here also!
Thank you so much.
NOTE: Anyway, I am using MS VS VC++ .NET 2003
anaknakal
|
|
|
|
|
Hi all! I want to create a list view dialog. It has performance with a left column has some icons and the right is the space displays content of icons in the left. Any one can help me ??? anyone can give me a sample similar like that ????
Best regard
You can try until you die!
|
|
|
|
|
Using AppWizard, create a dialog-based project, and add a list control to the dialog template. Is that what you had in mind?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hai,
Can i disable the One Page/Two Page button in the print preview window?
pls help with a sample code.
thank u...
|
|
|
|
|
This buttonshould automatically be disaed when you have 1 or less pages of output to print.
Typically you set the number of pages to print in OnPreparePrinting()
pInfo->SetMaxPage(1);
should disable the button, as you only have 1 page of output.
If you vote me down, my score will only get lower
|
|
|
|
|
...but, my print is having more than 1 page and i dont want the users to have this 1/2 page button facility.
i used a code like this (i put in in OnPrint() ), but crashed.
if( pInfo != NULL)
{
if (pInfo->m_bPreview)
{
CButton* p = (CButton*)GetWindow(GW_CHILD);//AFX_ID_PREVIEW_NUMPAGE
p->EnableWindow(FALSE);
}
}
is there any solution?
or is it a bad practice to try to modify fremework's buttons?
thanking u,
|
|
|
|
|
I have a menu and I want to check/uncheck a particular option. I got it working once but it now it either crashes the app or doesn't work at all. I haven't changed the menu structure or anything.
The menu has 4 main items, "File", "View", "Action", "Help" in that order from left to right. Under "Action", I have "Analyze" and "Transmit" in that order from top to bottom. Finally, in a submenu under "Transmit", I have "Open Port", "Transmit Data", a seperator, then "Options" from top to bottom. The "Open Port" menu item is the one I want checked and unchecked when the port is open or not. The menu ID of that item is "ID_TRANSMIT_OPENPORT".
In my code in InitInstance, I have this:
m_pMainWnd = pFrame;<br />
CMenu *cm_mainMenu = pFrame->GetMenu();<br />
m_transmitMenu = cm_mainMenu->GetSubMenu(2);
m_transmitMenu is a pointer to a CMenu type in the app class
and when I want to check the menu, I have the command:
m_transmitMenu->CheckMenuItem(ID_TRANSMIT_OPENPORT, MF_BYCOMMAND | MF_CHECKED);
I tried switching it to by position instead of command, but I get no change. I tried to debug it and in InitInstance, the value of m_transmitMenu looks valid. However, by the time it should check the item, m_transmitMenu has a valid memory address, but inside it, the menu handle, m_hMenu, points to 0xfeeefeee which isn't valid. Anyone know what I can try to fix this, I'm just spinning my wheels. Thanks in advance, Nate.
I have a thread issue to work out too, which I may illicit the help of you guys and gals later if I run out of things to try.
|
|
|
|
|
|
Actually, I am going to make an MFC application in which an user can draw a DFD(Data Flow Diagram).Practically it will be analogous to a normal "paint" program.But the difference is that ,it will consist of a circle tool ,to draw a process,which must be clickable so that if the process is multilevel,it can show up the inner DFD of the concerned process when clicked,in a child dialog.
Would please let me know the steps in VC++!!
My another problem is how can I implement a tool(same as TEXT button tool in MS PAINT) which can be used to put down a text at runtime in the user's pointed location within user's drawable area?
|
|
|
|
|
I believe MFC does it by using CRegions you might want to just create an object that contains a CRegion as well as the information on your various objects, then you can either write a simple psuedo handler in OnLButtonDown, or a more complex system within the object itself.
|
|
|
|
|
have a look at this :
UML Editor[^] ( by Johan Rosengren, here on CP ), it's could be a good start for your project.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hello everyone... Im new here, and kindda need some help please. Im trying to make a program in C code to download web page and store contents to a file. I have the socket creation and rule definition partfor Client done, but im not sure how to insert the get function, and about the syntax of the function.
<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
<br />
int main (int argc, char *argv[] )<br />
{<br />
int s, n;<br />
struct sockaddr_in sin; struct hostent *hptr;<br />
char msg[80] = "Hello World!";<br />
if ( argc < 3 ) {<br />
printf ("%s host port\n", argv[0] ); <br />
return -1;<br />
}<br />
if ( (s = socket(PF_INET, SOCK_STREAM, 0 ) ) < 0) { <br />
perror("socket"); <br />
return -1;<br />
}<br />
sin.sin_family = PF_INET; <br />
sin.sin_port = htons(atoi(argv[2])); <br />
if ( (hptr = gethostbyname(argv[1]) ) == NULL){<br />
fprintf(stderr, "gethostname error: %s", argv[1]);<br />
return -1;<br />
}<br />
memcpy( &sin.sin_addr, hptr->h_addr, hptr->h_length);<br />
if (connect (s, (struct sockaddr *)&sin, sizeof(sin) ) < 0 ){<br />
perror("connect"); return -1; <br />
}<br />
if ( write(s, msg, strlen(msg) +1) < 0 ) { <br />
perror("write"); return -1; <br />
}<br />
if ( ( n = read(s, msg, sizeof(msg) ) ) <0) { <br />
perror("read"); return -1; <br />
}<br />
printf (" %d bytes: %s\n", n, msg); <br />
<br />
if (close(s) < 0) {<br />
perror("close"); <br />
return -1;<br />
}<br />
return 0;<br />
}<br />
I need the code for the request from the Client, and the response from the Server.
Please, help me ASAP... thanks to you in advance.
Please feel free to point out any errore in my code.
|
|
|
|
|
This code acts as a client...you can use any http server like apache or simple server
hope this solves your problem
#include <stdio.h>
#include <windows.h>
#define HTTP_SERVER_PORT 80
#define HTTP_SERVER_ADDRESS "Put your IP address here"
int main ()
{
int ret = 0, sock = 0, cl_sock = 0, client_addr_len = 0, recv_len = 0;
char recv_buff [2048] = {0,}, send_buff [1024] = {0,0};
struct sockaddr_in server_addr;
WSADATA wsaData;
printf ("\nConnecting to the Server [%s] on port [%d]\n", HTTP_SERVER_ADDRESS, HTTP_SERVER_PORT);
ret = WSAStartup (MAKEWORD (1,1), &wsaData);
if (ret != 0)
{
printf ("\nerror initializing Winsock\n");
return -1;
}
sock = socket (AF_INET, SOCK_STREAM, 0);
if (sock <= 0)
{
printf ("\nerror opening socket\n");
WSACleanup ();
return -1;
}
server_addr.sin_family = AF_INET;
server_addr.sin_addr.s_addr = inet_addr (HTTP_SERVER_ADDRESS);
server_addr.sin_port = htons (HTTP_SERVER_PORT);
if (connect (sock, (struct sockaddr*)&server_addr, sizeof(server_addr)) == SOCKET_ERROR)
{
printf ("Unable to connect to server\n");
closesocket (sock);
WSACleanup ();
return -1;
}
sprintf (send_buff, "%s", "GET HTTP/1.1\r\nConnection: close\r\nHost: HTTP_SERVER_ADDRESS\r\n\r\n");
ret = send (sock, send_buff, strlen (send_buff), 0);
printf ("Sent [%d] bytes Request [%s]\n", ret, send_buff) ;
recv_len = SOCKET_ERROR;
while( recv_len == SOCKET_ERROR )
{
recv_len = recv (sock, recv_buff, 1024, 0);
if (recv_len == 0 || recv_len == WSAECONNRESET)
{
printf( "Connection Closed.\n");
break;
}
if (recv_len < 0)
return -1;
}
printf( "\nBytes Recv: %ld\n\n", recv_len);
printf ("Received Data [%s]\n", recv_buff) ;
/*{
int i = 0 ;
for (i=0;i
|
|
|
|
|
Or you could just use URLDownloadToFile() .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thank you Vinnzy And Ravi for you help..
Vinnzy, Thanks alot for the code. Ravi, i was aware of the urldownloadtofile(),
but wasnt sure if its the right thing to use.
Ill Try them out and post the results.
Thnaks again ..
|
|
|
|
|
Suppose I have the Instruction class Memory class, and I need to create a ListNode class which defined in Memory.h right now. Here is one of the requirments.
The overloaded operator[] of Memory clas returns a reference to the Instruction with the address corresponding to the index parameter of the operator[] method.
address is int variable in Instruction class.
How the operator overloading should be?
class ListNode
{
Instruction inst;
ListNode *head;
ListNode *next;
ListNOde();
~ListNode();
int &operator[] ( int );
};
|
|
|
|
|
You need to show your declaration for the Instruction class.
Bob Ciora
|
|
|
|
|
I have the following code, which runs w/out erroe, but fails to return the proper values...
<br />
#include <math><br />
#include "stdafx.h"<br />
#include <fstream><br />
#include <iomanip><br />
#include <iostream><br />
using namespace std;<br />
<br />
const double PI = 3.141592653589793238462643383279502884197;<br />
double q = 1000;
double pi = 5000;
double rw = 0.25;
double h = 100;
double por = 0.2;<br />
double k = 200;
double ct = 0.00003;
double Bo = 1.2;
double visc = 1.3;
double C = 0.5;
double S = 10;<br />
double tp = 200;
double delta_t = 200;
double a0,a1,a2,a3,a4,a5,b1,b2,b3,b4,c1,c2,c3,c4;<br />
double a[50],b[50],c[50],expint;<br />
<br />
double t[50],qsf[50],alpha,x[50],EI[50],beta[50],pd[50],pwf[50];<br />
<br />
double time_hr()<br />
{<br />
double N=49.0;<br />
for (int i=0;i<50;i++)<br />
{<br />
t[i] = 0.01*exp((i/N)*log(200/0.01));<br />
}<br />
return t[i];<br />
}<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
ofstream outputdeck;<br />
outputdeck.open("output.txt", ios::out);<br />
<br />
outputdeck<<"Type A: With Wellbore Storage.\n";<br />
outputdeck<<"Time"<<setw(5)<<"Pwf"<<setw(5)<<endl;<br />
for(int i=0;i<50;i++)<br />
{<br />
outputdeck<<t[i]<<endl<br />
}<br />
<br />
<br />
return 0;<br />
}
This code returns a value of 0 for every value of i. t[i] is supposed to increase from 0.01 to 200 as i increases from 0 to 49.
Can anyone pls tell me what i'm doing wrong?
Thank you.
|
|
|
|
|
This code does not call time_hr(), to change the values stored in t.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|